title: Generating the power set of a String
body: <p>So I'm trying to create a method that generates the power set of a given string. So far, I've come up with this which incorrectly outputs "[abc, bc, c, b, ac, c, a, ab, b, a]".</p>
  
  <pre><code>public static ArrayList&lt;String&gt; powerSet(String s){
          ArrayList&lt;String&gt; set = new ArrayList&lt;String&gt;();
  
          if(!s.isEmpty())
          set.add(s);
  
          for(int i=0; i&lt;s.length();i++){
              String substring = s.substring(0, i) + s.substring(i+1);
              set.addAll(powerSet(substring));
          }
  
  
          return set;
       }
  </code></pre>
  
  <p>This is for part of a homework assignment, and I'm not allowed to create any sort of helper class, and the method must be of type ArrayList. The method must involve recursion.</p>
  
  <p>I appreciate any help!</p>