private static List<String> oneCharApart(String s, Set<String> dict, Map<String, String> parentMap) {
        List<String> result = new ArrayList<>();
        if(s == null || dict == null){
            return result;
        }

        for(String word : dict) {
            if(!parentMap.containsKey(word)) {
                if(word.length() == s.length()) {
                    int diff = 0;
                    for( int i = 0; i< s.length(); i++) {
                        if(s.charAt(i) != word.charAt(i)) {
                            diff++;
                        }
                    }
                    if(diff == 1) {
                        result.add(word);
                    }
                }
            }
        }

        return result;
    }