Leetcode 282 Expression Add Operators

preview_player
Показать описание


My gears:

Рекомендации по теме
Комментарии
Автор

Such a great one.
Things to learn from this video
1. Time complexity for backtracking clearly explained : O(number of choices ^ (length-1))
2. Different in memory requirement for BFS and DFS
- BFS : memory equivalent to the number of final level leaf nodes of recursion tree or last level queue if iterative.
- DFS : linear memory for one complete path
3. new way of one pass string expression evaluation without using stack
4. patterns of calling next steps for recursion : All potential starting ways * 4 choices with each start
5. how edge case of removing "00" is handled
- if num[new_starting_index]=="0" and new_starting_string !="0"
- This means, if new starting string will start with "0", it can only be "0". not "01", not"02", not "00" or anything else.
6. logic to handle initial recursion call within the function.

davidoh
Автор

My man really did this on the spot in 20 minutes wow. Hope I get as good as you someday haha

charlesz
Автор

Thanks Ren, This is one of the most simple and intuitive explanation I can found on Internet :), Keep doing good work !!

codedoctor
Автор

Great explanation!! Thank you you really helped me out

CDJohnson
Автор

Thanks man, great one!
Had a tough time understanding this based on the official solution.

Also inspired by your streaming of the solving videos. Gonna do myself too, will help in communicating the thoughts better while solving in interview.

bhavulgauri
Автор

smart explanation, keep up with your channel, hope it becomes bigger

wukunliu
Автор

By looking at the code Time complexity should be O(N*3^(N-1)) as there are 3 dfs calls, right??

tarun
Автор

Thanks for the explanation, I would have been more happy if you don't have that loud keyboard sound.

TummalaAnvesh
join shbcf.ru