Skip to content

Commit 893fd6d

Browse files
committed
solve : implement trie prefix add : time complexity on word search
1 parent 88f6f34 commit 893fd6d

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

implement-trie-prefix-tree/samthekorean.py

Whitespace-only changes.

word-search/samthekorean.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# TC : O(N * 4^L), where N is the number of cells in the board and L is the length of the word.
2+
# SC : O(L) due to the recursive calls in the backtrack function, where L is the length of the word.
13
class Solution:
24
def exist(self, board, word):
35
def backtrack(i, j, k):

0 commit comments

Comments
 (0)