Tag Archives: first non-repeating

First non-repeating or unique character in a stream of characters

Given a stream of characters, find the first non-repeating i.e. unique character occurred. For example, in a stream [a,c,b,a,d,a,…] first unique is ‘c’ but if another ‘c’ character comes to stream [a,c,b,a,d,a c,…] then first unique would be ‘b’. We need some data structure that can maintain the order of each character appearing first time […]