How many numbers are there between 100 and 1000 which exactly have one of their digits as 7?
Please answer efficiently.
How many numbers are there between 1 and 1000 with their sum of digits ≤ 5?