private void traverseTrie(TrieNode node, char letter, String word, int[] prevRow, int k, Trie theTrie, StringBuilder single, List<String> result){
        int len = prevRow.length;
        int[] currRow = new int[len];
        currRow[0] = prevRow[0] + 1;

        for(int i = 1; i < len; i++){
            if(letter == word.charAt(i - 1)){
                currRow[i] = prevRow[i - 1];
            }else{
                currRow[i] = Math.min(Math.min(currRow[i - 1], prevRow[i]), prevRow[i - 1]) + 1;
            }
        }
        single.append(letter);
        if(node.isWord){
            if(currRow[len - 1] == k){
                result.add(single.toString());
            }
        }

        for(Character ch : node.children.keySet()){
            traverseTrie(node.getChild(ch), ch, word, currRow, k, theTrie, single, result);
            single.deleteCharAt(single.length() - 1);
        }
    }