cheat_sheet = [1, 10, 91, 739, 5275, 32491, 168571, 712891, 2345851, 5611771] class Solution(object): def countNumbersWithUniqueDigits(self, n): return cheat_sheet[n] if n<11 else cheat_sheet
@MingHan1990 I guess none of the test cases check for values of n greater than or equal to 11. Otherwise, you'd have an IndexError. There are only 10 elements in the array and the last element is at index 9. Either delete the else entirely or change it to cheat_sheet
@grodrigues3 Thx for correcting my error~
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.