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>

<p>You can try out this simple python implementation, which is based on the concept of using a <strong>HashMap</strong>:</p>

<pre><code>li = ['ram','raj','ram','dev','dev']
hash = dict()
for item in li:
    if item in hash:
        hash[item] += 1
    else:
        hash[item] = 1

print "unique string(s):",

for key, value in hash.iteritems():
    if value == 1:
        print key,
</code></pre>

java python c++ string algorithm