diff --git a/Data-Structures/Tree/Trie.js b/Data-Structures/Tree/Trie.js index 1e00daf53..61b4f03c1 100644 --- a/Data-Structures/Tree/Trie.js +++ b/Data-Structures/Tree/Trie.js @@ -87,7 +87,7 @@ Trie.prototype.remove = function (word, count) { // if the object forms some other objects prefix we dont delete it // For checking an empty object // https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object - if (child.count <= 0 && (Object.keys(child.children).length && child.childre.constructor === Object)) { + if (child.count <= 0 && (Object.keys(child.children).length && child.children.constructor === Object)) { child.parent.children[child.key] = undefined } } diff --git a/Dynamic-Programming/SudokuSolver.js b/Dynamic-Programming/SudokuSolver.js index bbba70e7b..23e913536 100644 --- a/Dynamic-Programming/SudokuSolver.js +++ b/Dynamic-Programming/SudokuSolver.js @@ -21,14 +21,14 @@ const isValid = (board, row, col, k) => { return true } -const sodokoSolver = (data) => { +const sudokuSolver = (data) => { for (let i = 0; i < 9; i++) { for (let j = 0; j < 9; j++) { if (data[i][j] === '.') { for (let k = 1; k <= 9; k++) { if (isValid(data, i, j, k)) { data[i][j] = `${k}` - if (sodokoSolver(data)) { + if (sudokuSolver(data)) { return true } else { data[i][j] = '.' @@ -44,7 +44,7 @@ const sodokoSolver = (data) => { // testing (() => { - if (sodokoSolver(_board)) { + if (sudokuSolver(_board)) { console.log(_board) } })()