You really did a fantastic job … easiest & clear explanation… that’s awesome … I prefer recursion approach ..
@dnm993110 ай бұрын
You’re really good at explaining things! Please make more videos! You just gained a sub!
@ebenezeracquah478 Жыл бұрын
Thanks for the video explanation.
@CreativeMining413 Жыл бұрын
Is there a way we can use memoization to optimize this even further or it wouldn't make a difference? Great vid btw
@m.y.72304 ай бұрын
very good explanation thanks
@subee12810 ай бұрын
Thanks
@spoiltchild65172 жыл бұрын
Facing "Time Limit Exceeded" error with same solution
@crackfaang2 жыл бұрын
Double check your DFS function for accidentally getting caught in an infinite loop. Otherwise if the code is the same I have noticed that for extremely popular questions so many people have answered it that the cutoff times for the code judge have become skewed and solutions that are valid solutions will now TLE.
@spoiltchild65172 жыл бұрын
@@crackfaang I found the solution by adding the following code at beginning: # To prevent TLE,reverse the word, if frequency of the first letter is more than the last letter's board_count = defaultdict(int,sum(map(Counter,board),Counter())) if board_count[word[0]] > board_count[word[-1]]: word = word[::-1]