title: Сertain number counter
body: <p>How to calculate how many numbers, for example from 1 to 1000, <strong>do not have more than 1 identical digit</strong> (example of a number where more than 1 identical digit: 11, 22, 119, 151, 777)</p>
  
  <p>My try (i made algorithm, but its work when number less 100)</p>
  
  <pre><code>public class Main {
      private static Scanner sc;
  
      public static void main(String[] args) {
          int Number;
          int Number2 =0;
          int ElevenFactor = 0;
  
          sc = new Scanner(System.in);
  
  
          System.out.println("\n Please Enter any Number: ");
          Number = sc.nextInt();
          if (Number&gt;11) {
              ElevenFactor = Number / 11;
  
          }else{
              ElevenFactor = 0;
          }
  
  
          while(Number2 != Number) {
              Number2++;
          }
          System.out.println("\n Answer");
          System.out.println(Number2 - Math.floor(ElevenFactor));
      }
  }
  </code></pre>
  
  <p>How do is must work:</p>
  
  <p>input: 30</p>
  
  <p>output: 28</p>
  
  <hr>
  
  <p>input: 99</p>
  
  <p>output: 90</p>