I believe the problem with my code is that the variable longest is set to the value of the variable counter. So when the value of counter changes (specifically when it passes the longest sequence) the longest sequence (3 according to the example input) is not being stored. I can't figure out how to store that value. If there is something else wrong please mention that as well; however, this is what I'm able to see but have not been able to solve.