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?
How many numbers are there between 1 and 100 such that at least one of their digits is 5?