Find the first non-repeating character from a stream characters
We need to understand the question first, then try to find the solution from the words in the sentence.
'first' $\Rightarrow$ Linklist is the good data structure to be thinking.
'non-repeating' $\Rightarrow$ HashMap is something on top of your head.

Apply LinkedList and HashMap
Use LinkedList to keep track of the first non-repeating character
Use HashMap to identify the repeating character
1. Read the current character from the stream
2. If the character is not in the HashMap, then insert the character to HashMap
3. If the character is in the HashMap, then the character is duplicate.
4. Get the Value from the HashMap, and check whether the value is null or not
5. If the Value is not null, then update the value to be null. Otherwise do nothing.
6. Return the first Node from the LinkedList if the LinkedList has at least one node.
7. Otherwise there is no non-repeating character

0. Given a stream: [a, b, b, ...]
1. Read first char: 'a'
2. Check the HashMap whether it contains 'a'
3. NO, insert 'a' to HashMap and append a Node contains 'a' to the LinkedList
4. Read second char: 'b'
5. Check the HashMap whether it contains 'b'
6. NO, insert 'b' to HashMap and append a Node contains 'b' to the LinkedList
7. Read third char: 'b'
8. Check the HashMap whether it contains 'b'
9. YES, get the reference to the Node contains 'b' in the LinkedList, remove the Node from the LinkedList
10. Update the value to be null with key equals 'b' in HashMap

Note: This is similar question for LRU[Least Recent Used] Cache
Use LinkedList and HashMap, but the Node has to contain key so that Node can be deleted from the HashMap when the Cache is full

static Integer nonRepeatingChar(Integer[] arr, int index){
        List<Node> list =  new LinkedList<Node>();
        if(arr != null){
            Map<Integer, Node> map = new HashMap<Integer, Node>();

            for(int i=0; i<arr.length; i++){
                if(i <= index){
                    Integer ch = arr[i];
                        Node node = new Node(ch);
                        map.put(ch, node);
                        Node vNode = map.get(ch);
                        if(vNode != null){
                            map.put(ch, null);
        if(list.size() > 0)
            return list.get(0).data;
            return null;