Junior — Senior
Counting occurrences of the digit 1 in the range from 0 to N
livecode
Task condition
You are given an integer N. You need to calculate how many times the digit 1 appears in the representation of all integers from 0 to N inclusive.
livecode
Task condition
You are given an integer N. You need to calculate how many times the digit 1 appears in the representation of all integers from 0 to N inclusive.