LeetCode Tutorial 17. Letter Combinations of a Phone Number

preview_player
Показать описание
GoodTecher LeetCode Tutorial 17. Letter Combinations of a Phone Number

LeetCode Tutorial by GoodTecher. The tutorial provides a step-by-step demonstration on how to solve coding problems.

Complete Playlist for the GoodTecher LeetCode Tutorial:

GoodTecher Website:

GoodTecher Channel on YouTube:

GoodTecher Github:

GoodTecher Facebook

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

Great video bro! You did a really good job with the sketch board walkthrough and its very easy to see what is happening with recursion. Keep this up!

mohammadakhtar
Автор

Perfect explanation, i watched complete video. Perfect description of hashmap and its uses. Good one and once again thanks for your work.

chinmayanand
Автор

Keep up the great work.. These are extremely helpful

shabbirsaifee
Автор

Keep making videos dear, it helps a lot. Thank you for your efforts.

chinmayanand
Автор

I like the solution very much. It helped a lot. IMO, we can move number to characters map as static member of class and no need to pass it again to method letterCombinationsHelper. Keep adding new stuff.

RajeshDwivediLucknow
Автор

using sb.length() as a counter is brilliant.

Regisrozario
Автор

I am a bit confused as to why the `digits.length == sb.length` check works. If we have a input string of "000", `sb.length` will never be == `digits.length`

ihopethiscommentisntabusiv
Автор

I am struggling with understanding how this line :

is getting each character in the digit and then adding that to the next character. say we have a digit "23" as given in your example. sb.length is *2* .
So, the for loop gets all the values at key 2 in the map which are *'a', 'b', and 'c' *. so, the next line
adds the character 'a' to the string builder and then recursively calls the helper again but sb. length now is *1* so, on a second call, the maps get the key 1 and not 3. Am confused. Could someone explain how each character in key 2 is added to each character in key 3 given a digit "23" from the code? I am so so confused looking at the code.

lawrencejustin
Автор

what is the time and space complexity>

SudeeptaSood
Автор

you didn't clearly describe the enhanced for loop, first sb.length 2, charAt 2 is a then a is added to ch, then sb length is 1, charAt 1 is digit 3, it will combine with a and make ad. it is making no sense, As a beginner I m very confused. i am following ur channel bt nw I am stuck. plz make clear

abdullahalnoman