title: Generate all possible strings in a range
body: <p>I need to generate all possible strings in a specific range. 
  For example<br>
  Upper bound - <code>aaa</code><br>
  Lowe bound - <code>ccc</code> </p>
  
  <p>Also possible cases <code>aab-caa</code> , <code>hhu - kkk</code> , but not <code>aaz - ccc</code>
  Values should be    </p>
  
  <pre><code>    aaa
      aab
      aac
      aba
      abb
      abc
      aca
      acb
      acc
      caa
      cab
      cac
      cca
      ccb
      ccc
  </code></pre>
  
  <p>I wrote such method but it doesn't work correctly, I have no idea how to do this correctly, it is too hard for me now to catch all possible cases, please help </p>
  
  <pre><code> public static List&lt;String&gt; generateAllPossibleStrings(String start, String end) {
          if (start.length() != end.length()) {
              return null;
          }
          List&lt;String&gt; variants = new ArrayList&lt;&gt;();
          char startArray[] = start.toCharArray();
          char endArray[] = end.toCharArray();
          char currentArray[] = Arrays.copyOf(startArray, startArray.length);
          variants.add(new String(currentArray));
          for (int i = startArray.length - 1; i &gt;= 0; i--) {
              while (currentArray[i] != endArray[i]) {
                  currentArray[i]++;
                  variants.add(new String(currentArray));
                  for (int j = startArray.length - 1; j &gt; i; j--) {
                      while (currentArray[j] != endArray[j]) {
                          currentArray[j]++;
                          variants.add(new String(currentArray));
                      }
                      currentArray[j] = startArray[j];
  
                  }
              }
              currentArray[i] = startArray[i];
          }
  
          System.out.println(Arrays.toString(variants.toArray()));
          return variants;
      }
  </code></pre>
  
  <p>For the example above I got </p>
  
  <pre><code>[aaa, aab, aac, aba, abb, abc, aca, acb, acc, baa, bab, bac, bba, bca, caa, cab, cac, cba, cca]
  </code></pre>
  
  <p>As you can see some values are missing. </p>
  
  <p>Please help to correct this method and make it work correctly or maybe it should be implemented as recursive method.</p>
  
  <p><strong>EXPLANATION</strong></p>
  
  <p>Why <code>aaz - ccc</code> is not possible because any character in lower bound (<code>ccc</code>) should be grater that corresponding character in the upper bound (<code>aaz</code>) in this example <code>z</code> is grater than <code>c</code> so this is incorrect.</p>