title: Find the longest word given a collection
body: <p>It is a google interview question and I find most answers online using HashMap or similar data structure. I am trying to find a solution using Trie if possible. Anybody could give me some hints?</p>
  
  <p>Here is the question:
  You are given a dictionary, in the form of a file that contains one word per line. E.g., </p>
  
  <pre><code>abacus 
  deltoid 
  gaff 
  giraffe 
  microphone 
  reef 
  qar 
  </code></pre>
  
  <p>You are also given a collection of letters. E.g., </p>
  
  <pre><code>{a, e, f, f, g, i, r, q}. 
  </code></pre>
  
  <p>The task is to find the longest word in the dictionary that can be spelled with the collection of 
  letters. For example, the correct answer for the example values above is “giraffe”. (Note that 
  “reef” is not a possible answer, because the set of letters contains only one “e”.)</p>
  
  <p>Java implementation would be preferred.</p>