Editorial for DMOPC '15 Contest 4 P5 - Scribe
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
An easy approach is to count the occurrences of each digit for and separately, then subtract to get the answer.
Time Complexity:
Comments
Can I get a better explanation for finding the number of digits x from 1 to y?