package com.anuragkapur.pie.arraysandstrings;

import java.util.HashMap;
import java.util.Map;

/**
 * @author anuragkapur
 */
public class FirstNonRepeatedChar {

    Map<Integer, Integer> charTracker = new HashMap<>();

    public String find(String str) {

        int i = 0;

        while (i < str.length()) {

            int codePoint = str.codePointAt(i);

            if (charTracker.containsKey(codePoint)) {
                if (charTracker.get(codePoint) == 1) {
                    charTracker.put(codePoint, 2);
                }
                // if more than one repetition, ignore updating. We only care about finding if repetitions are 0, 1
                // or more than 1
            } else {
                charTracker.put(codePoint, 1);
            }

            i += Character.charCount(codePoint);
        }

        i = 0;
        while (i < str.length()) {
            int singleChr = str.codePointAt(i);

            if (charTracker.get(singleChr) == 1) {
                return new String(Character.toChars(singleChr));
            }

            i += Character.charCount(singleChr);
        }

        return null;
    }
}

@@ -895,25 +895,25 @@
     int 
-singleChr
+codePoint
  = str.c
@@ -960,25 +960,25 @@
 ker.get(
-singleChr
+codePoint
 ) == 1) 
@@ -1031,25 +1031,25 @@
 toChars(
-singleChr
+codePoint
 ));%0A    
@@ -1100,17 +1100,17 @@
 unt(
-singleChr
+codePoint
 );%0A 

Refactor variable name