1012. Numbers With Repeated Digits
1012. Numbers With Repeated Digits
Description
Solution
- The most important tricky point, just find integers have no repeated digit!!!
- Then use DFS to solve the problem
- A naive way is to find the permutation -> TLE
- To speed up, we can directly compute permutation that has less digits than
n
‘s, then use DFS to compute the combination whose digit equals to n
Code
1 | class Solution { |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.