The "smartest" solution is pretty easy. You have a vector(an array if you will), where the x coordinate is the index, and the content is the y coordinate. Doing this, finding out whether or not a...