Make checkGrid accept HashMap<Integer, HashSet<Integer>>