Also is the input always integers or is there some “junk” mixed in?
A surprising number of people have a lot of trouble with the reading loop/termination condition.
Also is the input always integers or is there some “junk” mixed in?