Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 17ac987

Browse files
Merge pull request TheAlgorithms#740 from keshav-bohr/issue-resolve
fixed the issue in Trie file and typo in sudoku
2 parents 82ad8c8 + 1c22f65 commit 17ac987

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

‎Data-Structures/Tree/Trie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ Trie.prototype.remove = function (word, count) {
8787
// if the object forms some other objects prefix we dont delete it
8888
// For checking an empty object
8989
// https://stackoverflow.com/questions/679915/how-do-i-test-for-an-empty-javascript-object
90-
if (child.count <= 0 && (Object.keys(child.children).length && child.childre.constructor === Object)) {
90+
if (child.count <= 0 && (Object.keys(child.children).length && child.children.constructor === Object)) {
9191
child.parent.children[child.key] = undefined
9292
}
9393
}

‎Dynamic-Programming/SudokuSolver.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ const isValid = (board, row, col, k) => {
2121
return true
2222
}
2323

24-
const sodokoSolver = (data) => {
24+
const sudokuSolver = (data) => {
2525
for (let i = 0; i < 9; i++) {
2626
for (let j = 0; j < 9; j++) {
2727
if (data[i][j] === '.') {
2828
for (let k = 1; k <= 9; k++) {
2929
if (isValid(data, i, j, k)) {
3030
data[i][j] = `${k}`
31-
if (sodokoSolver(data)) {
31+
if (sudokuSolver(data)) {
3232
return true
3333
} else {
3434
data[i][j] = '.'
@@ -44,7 +44,7 @@ const sodokoSolver = (data) => {
4444

4545
// testing
4646
(() => {
47-
if (sodokoSolver(_board)) {
47+
if (sudokuSolver(_board)) {
4848
console.log(_board)
4949
}
5050
})()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /