How to find the non-repeating string from the list of string
<p>There is given a list of strings out which we have to print the unique strings. Unique string is a string which is not repeated in the list of string.</p>

<pre><code>Ex li = [ram,raj,ram,dev,dev]
unique string = raj. 
</code></pre>

<p>I thought of one algorithm. </p>

<p>First sort the String array, then check the adjacent string if its equal then move forward otherwise its a unique string.
But here the time Complexity is very high for sorting the string array.</p>

<p>Can any body help me in finding the more efficient algorithm then mine algo?
Thanks in advance.</p>

<h2>Solution 1</h2>

<p>You can solve your problem in O(n) complexity.</p>

<p>just create a <a href="https://en.wikipedia.org/wiki/Hash_table" rel="nofollow">hash table</a> to store the word counters, and than access just the words with <code>count == 1</code></p>

<h2>Solution 2</h2>

<p>This solution is not Liniar time, but stil been a good one.</p>

<p>You can create a <a href="https://en.wikipedia.org/wiki/Trie" rel="nofollow">Trie</a> with a count property, so will be easy to find the nodes with <code>count == 1</code></p>

java python c++ string algorithm