Sunday, January 25, 2015

Find Kth Non Repeating Character

Given a string find the Kth non repeating character from it.
Given a string find the first non repeating character from it.


For example if input is "deepaksinghvi", expected output is:

hashtable: {p=1, n=1, k=1, i=2, h=1, g=1, e=2, d=1, a=1, v=1, s=1}
d

linkedhashmap: {d=1, e=2, p=1, a=1, k=1, s=1, i=2, n=1, g=1, h=1, v=1}
d

linkedhashmap: {d=1, e=2, p=1, a=1, k=1, s=1, i=2, n=1, g=1, h=1, v=1}
p

No comments:

Post a Comment