No video

word search | word search leetcode | leetcode 79 | backtracking | dfs

  Рет қаралды 9,750

Naresh Gupta

Naresh Gupta

Күн бұрын

Problem Link - leetcode.com/e...
Subscribe for more educational videos on data structure, algorithms and coding interviews - www.youtube.co...
July Challenge - leetcode.com/e...
Code Repository - github.com/nar...
June LeetCoding Challenge Playlist: • LeetCode June Challenge
May LeetCoding Challenge Playlist: • LeetCode May Challenge
LeetCode Recent Contest ProblemsPlaylist: • Leetcode
#WordSearch #Backtracking #Recusrion #Coding #Programming #Interview #Practice #Leetcode #79 #Algorithm #Java #Preparation

Пікірлер: 25
@SW-rn4mg
@SW-rn4mg 2 жыл бұрын
Can you please explain more of backtracking approach? I've seen lots of solutions but rarely an explanation regarding backtracking. Thanks!
@NeerajPandeyNeal
@NeerajPandeyNeal Жыл бұрын
check at line 5 word.charAt(0)== board[ij is not required,
@NareshGupta
@NareshGupta 3 жыл бұрын
Time Complexity - O(M * N * 4^L) and Space Complexity - O(L), where M*N - board size, L - Word length.
@jaygaur4686
@jaygaur4686 3 жыл бұрын
Can we Reduce the time complexity or this is the best solution for this problem?
@04tridib
@04tridib 7 ай бұрын
We need to use Trie otherwise. @@jaygaur4686
@asmasadat8082
@asmasadat8082 3 жыл бұрын
You used '*' to see if the element was visited or not. But you are checking if the element is visited at every recursion.
@KaanErsan1
@KaanErsan1 Жыл бұрын
Yea I think in the 3rd if inside our own exist function, we also need to check if board[i][j] == "#" and return false if so (because we visited that location already).
@apoorvchaturvedi2493
@apoorvchaturvedi2493 3 жыл бұрын
Nice explanation!
@NareshGupta
@NareshGupta 3 жыл бұрын
Glad it was helpful!
@KaanErsan1
@KaanErsan1 Жыл бұрын
I converted this solution to Swift and when I submit, one of the testcases fails saying "Time limit exceeded". I'm fairly certain I converted it correctly so I'm not sure why this input fails with time limit exceeded: [["A","A","A","A","A","A"],["A","A","A","A","A","A"],["A","A","A","A","A","A"],["A","A","A","A","A","A"],["A","A","A","A","A","A"],["A","A","A","A","A","A"]] word ="AAAAAAAAAAAAAAB" Working on finding a solution to it and to preserve time by search pruning.
@bhargavimopuru8576
@bhargavimopuru8576 2 жыл бұрын
pls tell me how to find indexes of that word also
@deepkakadia5679
@deepkakadia5679 4 жыл бұрын
Keep up the good work!
@NareshGupta
@NareshGupta 4 жыл бұрын
thanks
@cs208anjaysahoo2
@cs208anjaysahoo2 4 жыл бұрын
Sir, why are you not posting your solution in the Discussion section of Leetcode?
@NareshGupta
@NareshGupta 4 жыл бұрын
Few hatters reported my post.
@cs208anjaysahoo2
@cs208anjaysahoo2 4 жыл бұрын
@@NareshGupta Sir I really appreciate your solution and kind of approach you give for a single problem. So please keep posting video and solution and don't let these hatter let you down.
@ms-lk6bw
@ms-lk6bw 2 жыл бұрын
@@NareshGupta y was your post reported
@NareshGupta
@NareshGupta 2 жыл бұрын
@@ms-lk6bw leetcode don't want someone to share video links in posts
@kapilsingh
@kapilsingh 4 жыл бұрын
Great work!!
@NareshGupta
@NareshGupta 4 жыл бұрын
Thanks a lot!
@muzammilansari381
@muzammilansari381 Жыл бұрын
time limit exceeded
@shyamprakashm6325
@shyamprakashm6325 4 жыл бұрын
Thanks you sir 😍😍😍😘
@NareshGupta
@NareshGupta 4 жыл бұрын
Thanks, Most welcome
@monkeytrollhunter
@monkeytrollhunter 3 жыл бұрын
I gave up after banging my head on the wall for two hours lol
@NareshGupta
@NareshGupta 3 жыл бұрын
I think you should use some threshold or takes break in between if you stuck in problem more than an hours looks for hint or move on some other problem and come back later on that problem
Word Search - Backtracking - Leetcode 79 - Python
10:18
NeetCode
Рет қаралды 304 М.
Gli occhiali da sole non mi hanno coperto! 😎
00:13
Senza Limiti
Рет қаралды 19 МЛН
天使救了路飞!#天使#小丑#路飞#家庭
00:35
家庭搞笑日记
Рет қаралды 91 МЛН
LeetCode Word Search Solution Explained - Java
12:08
Nick White
Рет қаралды 46 М.
5 Simple Steps for Solving Any Recursive Problem
21:03
Reducible
Рет қаралды 1,2 МЛН
Word Search
8:46
Kevin Naughton Jr.
Рет қаралды 139 М.
Backtracking (Think Like a Programmer)
13:02
V. Anton Spraul
Рет қаралды 325 М.
Word Search II | DFS + Map | DFS + TRIE | Leetcode #212
24:49
Solve Coding Interview Backtracking Problems - Crash Course
36:51
freeCodeCamp.org
Рет қаралды 179 М.
The Backtracking Blueprint: The Legendary 3 Keys To Backtracking Algorithms
13:44