title: Count all numbers with unique digits in a given range
body: <p>This is an interview question. Count all numbers with unique digits (in decimal) in the range [1,  N].</p>
  
  <p>The obvious solution is to test each number in the range if its digits are unique. We can also generate all numbers with unique digits (as permutations) and test if they are in the range.</p>
  
  <p>Now I wonder if there is a DP (dynamic programming) solution for this problem.</p>