4
Answers

to count number of 2's from 0 to 35

Write a method to count the number of 2's between 0 and n.
EXAMPLE:
input: 35
output: 14 [list of 2's: 2, 12, 20, 21, 22, 23, 24, 25, 26, 27,28, 29, 32]
Answers (4)