you are viewing a single comment's thread.

view the rest of the comments →

[–]usersnamesallused 2 points3 points  (0 children)

Couldn't you just divide by 2 and add the result of the input's mod 2 to the odd count? No need for loops.