Domanda di colloquio di J.P. Morgan

Basic algorithms questions. Such as integer counting.