title: Checking if a word is a sub-Anagram of another (Java)
body: <p>The words "unsold" &amp; "silo" are sub-anagrams of the word "insidiously". That is, they can be spelt using only letters from "insidiously". There are obviously many more, and this concept is the basis of a word game found in 'The Australian' newspaper. </p>
  
  <p>I'm trying to write a program that takes two arguments - a word, and another that might be a sub-anagram of this word and returns true if it is. So far this is what I've got:</p>
  
  <pre><code>public boolean isAnswer(String word, String base)
      ArrayList&lt;Character&gt; characters = new ArrayList&lt;&gt;();
      for(char x : base.toCharArray)
      {
          characters.add(x)
      }
      for(char y : word.toCharArray)
      {
          if(characters.contains(x))
          {
              characters.remove(x)
          }
          else
          {
              return false;
          }
      return true;
      }
  </code></pre>
  
  <p>It does work, but if I'm looping through every word in the English dictionary this will be extremely taxing on memory. How can I do this without creating an ArrayList local variable?                           </p>