問題:https://leetcode.com/problems/count-numbers-with-unique-digits/
1:10
2:10 + 9×9
3:10 + 9×9 + 9×9×8
4:10 + 9×9 + 9×9×8×7
......
クラス解決{ パブリック: INT countNumbersWithUniqueDigits(INT N){ 場合(Nの== 0)リターン 1 。 int型 llast = 1 ; int型最後= 10 ; 以下のために(int型 I = 2 ; iが<= N; iは++ ) { int型の結果=最後+(最後- llast)*(10 - (I - 1 ))。 llast = 最後。 最後 =結果; } を返す最後。 } }。