I checked the 1st and 3rd test case and if I understood well the problem, they must be wrong.
1st case: with 1 digit we have 2 numbers with only zeros or sevens: 0 and 7, but in the text 1 is the right answer.
3rd case: with 1 digit 0 and 7, with 2 digits 70 and 77, with 3 digits 700, 707, 770 and 777 (8 numbers at all, but the right output according to the text is 12.
Correct me if I'm wrong.
Thank you in advance.