title: permutations of a string using iteration
body: <p>I'm trying to find permutation of a given string, but I want to use iteration. The recursive solution I found online and I do understand it, but converting it to an iterative solution is really not working out. Below I have attached my code. I would really appreciate the help: </p>
  
  <pre><code>public static void combString(String s) {
      char[] a = new char[s.length()];
      //String temp = "";
      for(int i = 0; i &lt; s.length(); i++) {
          a[i] = s.charAt(i);
      }
      for(int i = 0; i &lt; s.length(); i++) {
          String temp = "" + a[i];    
  
          for(int j = 0; j &lt; s.length();j++) {
              //int k = j;
              if(i != j) {
                  System.out.println(j);
                  temp += s.substring(0,j) + s.substring(j+1,s.length());
              }               
          }
          System.out.println(temp);
      }
  }
  </code></pre>