Get Keypad Combination - Solution | Recursion | Data Structures and Algorithms in JAVA

Please consume this content on nados.pepcoding.com for a richer experience. It is necessary to solve the questions while watching videos, nados.pepcoding.com enables that.
NADOS also enables doubt support, career opportunities and contests besides free of charge content for learning. In this video, we discuss the solution of the famous Nokia Keypad question where we are required to find all the possible combinations obtained from certain presses on a keypad as explained in question. For a better understanding of this problem, click here: • Get Keypad Combination...
For a better experience and more exercises, VISIT: www.pepcoding.com/resources/o...
#pepcoding #programming #freeonlinecourses
Have a look at our result: www.pepcoding.com/placements
Follow us on our FB page: / pepcoding
Follow us on Instagram: / pepcoding
Follow us on LinkedIn: / pepcoding-education

Пікірлер: 201

  • @gaganverma7304
    @gaganverma73044 жыл бұрын

    Ur content gonna change the future of many it engineering aspirants great work ❤️❤️❤️❤️

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    Thanks a ton

  • @shubhamsonal5871

    @shubhamsonal5871

    3 жыл бұрын

    @@Pepcoding Please solve a problem called : rod cutting problem using recursion, here we need to maximise the number of cuts we can make. I am unable to understand the brute force approach of solving this using recursion. Link to the problem is ide.geeksforgeeks.org/ItQt4rQ0ND Please note, I am not expecting the DP solution but just a clarity on the given code. please make a video on this using recursion.

  • @bikramjitdas7000

    @bikramjitdas7000

    3 жыл бұрын

    @@shubhamsonal5871 yes sir I also got stuck. And I am learning from your playlist, I have a question sir, How to know I am now ready for thr interview,and also how to apply off campus for product based companies

  • @gungunsinghal9562

    @gungunsinghal9562

    3 жыл бұрын

    Yeah..thanks pepcoding

  • @nknidhi321
    @nknidhi3213 жыл бұрын

    "Submit karne walo ki kvi haar nahi hoti, but, shayad unka code udd jata h kvi kvi" Hilarious..😂😂😂

  • @Prasoonvarshney16

    @Prasoonvarshney16

    3 жыл бұрын

    lol

  • @nivealokhande2153

    @nivealokhande2153

    Жыл бұрын

    🤣🤣

  • @amanpreetsinghsetia1524
    @amanpreetsinghsetia15243 жыл бұрын

    Sir i did this on my own !... aapne faith se result nikalna sikha diya sir ache se thanks a ton :)

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    I am glad. Keep learning. Keep supporting. Your kind words are the kind of motivation that truly help me in making more and more content. Especially, these days, not everybody is generous with motivating anybody either. It means a lot

  • @nikitajaiswal9112

    @nikitajaiswal9112

    2 жыл бұрын

    Mujhse nhi bn paya mene previous questions khud kiye pr ye nhi bn paya Or eske pehle wala question bhi.. Ye question solve krne ke liye kis video ko achhe se dekhna h pepcoding ke any suggestion

  • @faizanhaider3953
    @faizanhaider3953 Жыл бұрын

    Not even a single teacher in KZread aur any another platform clear concept like you cleared in each n every lecture... Hats off sir... 🙏🙏

  • @harshpandey7605
    @harshpandey76053 жыл бұрын

    Iss channel ke aas paas koi aa nahi paega agle 5 saalon tak itna acha flow mein apdaya gya hai ye

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thank You!! Keep watching and share it with your peers

  • @harshitagnihotri4018

    @harshitagnihotri4018

    3 ай бұрын

    you were right . he is still on top

  • @udaykulkarni5639
    @udaykulkarni5639 Жыл бұрын

    hahaha 15:19 explanation level OP !! "Idhar baaalti hi khaali h.. But idhar baaalti me magga h.. magge me paani nahi h." I was laughing out loud!! Great explanation btw!! Keep it up

  • @lofigroove1912
    @lofigroove19122 жыл бұрын

    Sir your content is unmatchable. since I started watching your videos, DSA has become so simple. Thanks a ton.

  • @chiragchawla2902
    @chiragchawla29022 жыл бұрын

    Love your explanation sir, watched your prev videos and did this on my own. Thanks a ton.

  • @programmertik2046
    @programmertik20462 жыл бұрын

    The flow of this playlist was so great that,I solved this problem on myown Thnx Sir ,my first recursion problem!!

  • @bitqahdi6592
    @bitqahdi65923 жыл бұрын

    Simple solution for adding " " in arraylist is that " " will make the size of arraylist as 1 and the inner loop for(String rstr : rres) will run once for every character ( lets say abc for case of integer 2). Now if we did not add " " then the inner loop will never run and hence the size of arraylist will remain zero, final output will always be a zero size empty arraylist.

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Correct

  • @aahanaganjewar9951

    @aahanaganjewar9951

    3 жыл бұрын

    oh i see!

  • @aahanaganjewar9951

    @aahanaganjewar9951

    2 жыл бұрын

    [""] size = 1 meaning balti mein mugga h mugge mein pani nahi h [] size = 0 meaning balti he khali h

  • @nivealokhande2153

    @nivealokhande2153

    Жыл бұрын

    @@aahanaganjewar9951 when interviewer asks realf life example 🤣

  • @ayazshakeeb
    @ayazshakeeb2 жыл бұрын

    thanks sir, I am able to solve almost all the problem by getting the concept explained in first couple of videos of playlist. I did this problem also before looking at your solution .

  • @bsc.ca-42-ashwanikumar53
    @bsc.ca-42-ashwanikumar53 Жыл бұрын

    You are Doing great work for students like me who belong to a very small village and cannot afford any data structure course.

  • @vithleshkumargupta
    @vithleshkumargupta3 жыл бұрын

    Sir , Very good explanation to every question. Thanks for providing free content with such excellent explanation.

  • @hritikagrahari8314
    @hritikagrahari83143 жыл бұрын

    Very underrated video, this video deserves much more likes and views.

  • @AmanTheMystery
    @AmanTheMystery2 жыл бұрын

    esa content khi doodne se nhi milega salute sir for your effort

  • @raj_kundalia
    @raj_kundalia2 жыл бұрын

    Watched on 20 October, 2021 - Thanks for the video.

  • @adityakajale4403
    @adityakajale44033 жыл бұрын

    I understand recursion because of u sir thanks a lot

  • @projectsdb4034
    @projectsdb40342 жыл бұрын

    Your patience level is just amazing

  • @neerajnk2900
    @neerajnk29003 жыл бұрын

    sir.... you are so hardworking... you are a nice teacher... ekdum mast... chill hokar samjhate or wo bhi bhot mast tareeke se.. dil jeet liya sir apnr

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Dil ke badle linkedin pe ek post likh do beta ki aisa aisa ek channel mila jispe free content hai. Umeed karunga ki aap sirf video nahi dekhenge, question submit bhi karenge www.pepcoding.com/resources/online-java-foundation

  • @candyman6846
    @candyman68462 жыл бұрын

    Love your Teaching and your methodology

  • @chethanmr6595
    @chethanmr65953 жыл бұрын

    @15:25 Thank you Sir. Very graphical explanation...baalti me mug hai aur mug me paani nahi not just baalti me paani nahi hai

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    You are welcome and If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @sandeepnaikat5598
    @sandeepnaikat55988 күн бұрын

    Wonderful way of teaching great work done sir

  • @em_nikhil_007
    @em_nikhil_0073 жыл бұрын

    Thank you sir , mai aapke wajah se recursion seekh paaya hoon , nhi to mera pichle 6 months se dimaag kharaab ho rha tha jab bhi mai recursion ke problem dekhta tha...... lekin ab shi se ho jata hai . Thank you for providing free content . Its AWESOME.....

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thank You very much!! It's nice to hear this !! keep watching and share it with your peers

  • @em_nikhil_007

    @em_nikhil_007

    3 жыл бұрын

    @@Pepcoding sure sir i will share you channel . Congratulations for 10K..

  • @ganeshbansode9380
    @ganeshbansode93802 жыл бұрын

    Thank you for this explaination, because of you I saved myself from giving up on this recursion problems.

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Glad to know that you love our video, for better experience. Visit - nados.pepcoding.com and sign up to NADOS. Don't forget to follow us on Instagram instagram.com/pepcoding/

  • @kunalprashant1561
    @kunalprashant15612 жыл бұрын

    Thank you so much for this wonderful explaination

  • @tejaswinisingh6263
    @tejaswinisingh62633 жыл бұрын

    Duniya ki har problem ka explanation 2 ki power 0 , 1 hota hai ya 0, ab agar 2 ki power zero 1 sach hai to ye bhi sach hai:) thank you real life jeetu bhaiya :)

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    :-)

  • @444not
    @444not3 жыл бұрын

    Sir pakka pakka samajh aa Gaya !

  • @sanketkale1851
    @sanketkale18513 жыл бұрын

    You made difficult problem so easy and understandable, thank you sir

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @sukanyamahapatra4742
    @sukanyamahapatra47423 жыл бұрын

    After thinking for 2 hrs , I finally did the code by myself in c++, since i don't know java, Thank you sir for such type of questions

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Keep learning, Keep growing and keep loving Pepcoding!😊

  • @yashodeepdhas8408

    @yashodeepdhas8408

    3 жыл бұрын

    will u share me the code ?

  • @yashodeepdhas8408

    @yashodeepdhas8408

    3 жыл бұрын

    please ?

  • @sukanyamahapatra4742

    @sukanyamahapatra4742

    3 жыл бұрын

    @@yashodeepdhas8408 yes okay

  • @yashodeepdhas8408

    @yashodeepdhas8408

    3 жыл бұрын

    @@sukanyamahapatra4742 thanks and do connect on LinkedIn I have sent you request 😄

  • @nknidhi321
    @nknidhi3213 жыл бұрын

    You are the best teacher..🙏 Thanks.. beautiful explanation..❤️

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    It's my pleasure

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Glad to know that you liked the content and thank you for appreciating. The love and respect which I get from you people keep me highly motivated and the same I am able to forward It to you people through my videos. So, keep motivating, keep learning and keep loving Pepcoding😊

  • @nknidhi321

    @nknidhi321

    3 жыл бұрын

    @@Pepcoding Definitely sir, Prepcoding is the only channel with so much of detailed explanation.. coding se pehle approach, fir code, fir code k saath dry run, heaven.. !! ❤️❤️❤️

  • @arnavkukreti2009
    @arnavkukreti2009 Жыл бұрын

    best teacher for DSA

  • @yashsaxena9
    @yashsaxena94 жыл бұрын

    Very clear explanation sir, please keep the good work up Advice: at the start of solution video, please advice to watch the question video first and put its link in description, it might be confusing for new comer

  • @ayushgoel9584

    @ayushgoel9584

    4 жыл бұрын

    That is why sir always tell us to solve from portal, where everything is arranged :)

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    Yes, you are right

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    Noted

  • @sakshiaggarwal6199
    @sakshiaggarwal61993 жыл бұрын

    Awesome Explanation.

  • @joeljacob4685
    @joeljacob46853 жыл бұрын

    Wow sir you made recursion a very interesting topic Thank you sir..

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thankyou! If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )

  • @kushalappaca5324
    @kushalappaca53243 жыл бұрын

    What an explanation... 👏👏

  • @amanbedi93
    @amanbedi933 жыл бұрын

    Instead of returning arraylist with empty string, the base case can return the characters of last keystroke: if(str.Length == 1) { List templist = new List(); var tempindex = Convert.ToInt32(str); // last character is the index for kpc var itemKpctemp = keyPadCodes[tempindex]; // get the keypad code for the integer in input string str representing last character var kpccharstemp = itemKpctemp.ToCharArray(); // convert keypad to character array foreach (var tempchars in kpccharstemp) { templist.Add(tempchars.ToString()); // store each character as string into templist and return it to interact with rest of the kpc characters on the way down } return templist; } That way one recursive call is prevented (on the way down) and the base case looks easier to understand. P.S. this is C# implementation

  • @vnsrahulsri
    @vnsrahulsri3 жыл бұрын

    Amazing content on your channel for Recursion & Backtracking. Appreciate your efforts and contribution.

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    If you like my efforts, I request a review g.page/Pepcoding/review?rc

  • @dheerajyadav9099

    @dheerajyadav9099

    3 жыл бұрын

    @@Pepcoding excellent

  • @kamalnayan5331

    @kamalnayan5331

    2 жыл бұрын

    @Pepcoding Rated 5 *

  • @PawanKumar-fu2fh
    @PawanKumar-fu2fh Жыл бұрын

    Sir you are the best

  • @vrajeshbadgujar
    @vrajeshbadgujar Жыл бұрын

    Thanks a lot

  • @umangbehl8152
    @umangbehl81522 жыл бұрын

    cyrstal clear explanation

  • @kushsharma6653
    @kushsharma66533 жыл бұрын

    You can use this as base condition which is more easy to explain also: if(str.length() == 1){String keyValues = map.get(str); //using HashMap here. Ex --> {"1", "a,b,c"} String [] arr = keyValues.split(","); return Arrays.asList(arr); }

  • @ketansharma6955
    @ketansharma6955 Жыл бұрын

    very nice

  • @suvanshgupta7813
    @suvanshgupta78132 жыл бұрын

    balti hi khali hai balti mai mugga hai but mugge mai paani nhi hai xD Best Explanation Sir ji

  • @sachingoyal7443
    @sachingoyal74433 жыл бұрын

    Sir.. Outstanding video.. Wouldn't it be better to have base case as string.length ==1 and then return array of individual character in that.. With this, we can avoid empty array elem which is weired.

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Thankyu beta! And jo aap base case keh rh ho usse dubara analyse kro aur ek bari aache se dry run kr k dekho pura question dubara se. You'll automatically get the answer of your question.

  • @sachingoyal7443

    @sachingoyal7443

    3 жыл бұрын

    @@Pepcoding analyzed.. And found it correct.. Submitted solution on leetcode. It's working fine.

  • @511-neelbutani9

    @511-neelbutani9

    3 жыл бұрын

    @@sachingoyal7443 can you excalty say what you returned ?

  • @ProgrammingWithProject
    @ProgrammingWithProject2 жыл бұрын

    Sir you are great

  • @pankajbisht897
    @pankajbisht8973 жыл бұрын

    Could you comment on how optimum the solution is . Some comment on time complexity would be great. The content is great though

  • @MDArif-we2kg
    @MDArif-we2kg3 жыл бұрын

    sir, agar isme array pass ho toh instead of string. ??

  • @kunalks
    @kunalks Жыл бұрын

    It could be better if you explain TC and SC. and thanks for awesome video.

  • @kushagradiwan1684
    @kushagradiwan1684 Жыл бұрын

    sir jab mres toh har baar new create ho raha haiin,toh purana vaala kaise return ho skta?

  • @aashishgoyal1436
    @aashishgoyal14363 жыл бұрын

    you r an inspiring teacher

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    thank you

  • @divyabajpai3191
    @divyabajpai31912 жыл бұрын

    You are best

  • @sachinkun21
    @sachinkun213 жыл бұрын

    Humne ghabraana nai hai, haar nai manani, Humne sirf Faith Rakhna hai and Faith ko Expectation se connect krna hai.

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Correct

  • @yashkushwaha8492
    @yashkushwaha84923 жыл бұрын

    Sir it's fine to use this:- String s = arr[Integer.parseInt(String.valueOf(ch))]; For ascii code

  • @amitbajpai6265
    @amitbajpai6265 Жыл бұрын

    why are we not using stringBuilder instead of string as it gives the O(N) complexity when we try to add the strings.

  • @vivekbharti1792
    @vivekbharti17922 жыл бұрын

    I am the 1000th liker of this wonderful video class.

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Thankyou for your support. And for better experience, visit nados.io, where you will get well curated content and career opportunities.

  • @jolly_dollyyy
    @jolly_dollyyy2 жыл бұрын

    God level explanation!!

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Glad it was helpful! For better experience and well organised content sign up on nados.io Don't forget to follow us on Instagram instagram.com/pepcoding/

  • @abhisheksinghvlogs1339
    @abhisheksinghvlogs13397 ай бұрын

    kya baat hai sir

  • @parthsaraswat9744
    @parthsaraswat97443 жыл бұрын

    You are going to be viral in coming months

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like my efforts, I request a review g.page/Pepcoding/review?rc

  • @mallakbasheersyed1859
    @mallakbasheersyed18592 жыл бұрын

    Sir,do the empty character has ascii value

  • @itz_me_imraan02
    @itz_me_imraan022 жыл бұрын

    Dusre to sirf padhate hai,sir feel kra dete hai....💖

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Glad that you love our explanation. Visit nados.pepcoding.com and sign up to NADOS, for better experience, precisely arranged content. Don't forget to follow us on Instagram instagram.com/pepcoding/

  • @punitraj6529
    @punitraj65293 жыл бұрын

    Thank you so much for this wonderful explaination sir. By the way, What is the complexity of this code ?

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    You're welcome

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    If you like our efforts, please upvote the comments written by the students about Pepcoding here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )

  • @HarshKumar-nh6be

    @HarshKumar-nh6be

    3 жыл бұрын

    number of digits to the power n

  • @yadneshkhode3091
    @yadneshkhode30912 жыл бұрын

    thanks bhai

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Glad it helped! Keep learning. And for better experience and well organised content visit nados.pepcoding.com

  • @divyanshuyadav5524
    @divyanshuyadav55243 жыл бұрын

    I'm in love !! ❤️

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    wow, this cheers me up. I am glad we at pepcoding could be of help to you. Keep learning. Also, recommend us to your juniors and peers, they may also benefit

  • @Anand-zg6jv
    @Anand-zg6jv2 жыл бұрын

    "balti mai magga magge mai pani nhi" wah sir 😅

  • @sukhmansindhi2920
    @sukhmansindhi29203 жыл бұрын

    Sir, if i declare "codes" array in main and pass it to the getKPC(String s, String[] codes) like this in each call... How does it would affect Space Complexity in general?

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    koi nuksan nahi hoga, same rahegi. pass nahi kia aur har function call mei bnaya tab badhegi

  • @sukhmansindhi2920

    @sukhmansindhi2920

    3 жыл бұрын

    @@Pepcoding thank you sir.. Because of you I am now able to solve these recursive problems on my own....

  • @VaibhavSethF
    @VaibhavSethF3 жыл бұрын

    Sir, buffer reader is good, or Scanner class for user input in competitive coding? Sir, please reply!!!

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    buffer reader

  • @neelshah4812
    @neelshah48123 жыл бұрын

    great video

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Glad you enjoyed it

  • @Noob_Engineer3001
    @Noob_Engineer30014 жыл бұрын

    Sumit bhaiya str length has been given as constraint in the question to uska use kare na

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    Yes.

  • @jayat4702
    @jayat47024 жыл бұрын

    sir , level-up course bhi youtube pe ayega?

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    yes

  • @kunwaranas24
    @kunwaranas243 жыл бұрын

    Thankyou sir 😊

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    agar aapko content pasand aa rha hai to ek review de dijie please g.page/Pepcoding/review?rc

  • @kunwaranas24

    @kunwaranas24

    3 жыл бұрын

    @@Pepcoding ji bilkul sir

  • @kuntasunny8688
    @kuntasunny86882 жыл бұрын

    What is Time complexity?

  • @foodTeRecipe
    @foodTeRecipe3 жыл бұрын

    if we run this code for " " this case the output will be [" "] but the right answer should be [ ], how can i improve this can anybody help.

  • @utsavgupta746

    @utsavgupta746

    3 жыл бұрын

    Return empty vector krdo aur jab vector recieve kr rhe toh check krlo if mres.size() ==0 phir push krdo usme empty string. I hope u will get it 🙂

  • @511-neelbutani9

    @511-neelbutani9

    3 жыл бұрын

    @@utsavgupta746 bhai kese ?

  • @Prodcater

    @Prodcater

    2 жыл бұрын

    @@511-neelbutani9 in java how to do this?

  • @harcharansingh1997

    @harcharansingh1997

    Жыл бұрын

    @@Prodcater did you find solution

  • @tanyachhabra5537
    @tanyachhabra55372 жыл бұрын

    can someone pls share cpp code ?

  • @vaibhavagarwal9055
    @vaibhavagarwal9055 Жыл бұрын

    wrong answer not working on leetcode

  • @kuldeepnarayanminj
    @kuldeepnarayanminj4 жыл бұрын

    sir, it should be pure recurssion ? u used loop ? why ?

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    yes but loop is used for different purpose

  • @Prodcater
    @Prodcater2 жыл бұрын

    Anyone having java Leetcode solution .1 test case is Failing

  • @shubhampokhriyal8491
    @shubhampokhriyal84914 жыл бұрын

    Sir web development k coarse bhi aega KZread p??

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    hanji. poora aur jaldi.

  • @shubhampokhriyal8491

    @shubhampokhriyal8491

    4 жыл бұрын

    Thanks sir kbse aega??

  • @NikhilKumar-of5gb
    @NikhilKumar-of5gb4 жыл бұрын

    I am looking forward to join ur placement course, how can I approach you?

  • @Pepcoding

    @Pepcoding

    4 жыл бұрын

    We will do one around October. Announcement will be don eon the channel.

  • @NikhilKumar-of5gb

    @NikhilKumar-of5gb

    4 жыл бұрын

    @@Pepcoding I have sent a msg on pepcoding whatsapp no., Can u PLZZ reply there, I wanted to talk something

  • @hinamankani5319
    @hinamankani53193 жыл бұрын

    One doubt sir, what is the purpose of using static here: 'static String codes' instead of just 'String codes'

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    beta jo static bnaya wo sare functions mei global variable ki tarah mil jaega.

  • @hinamankani5319

    @hinamankani5319

    3 жыл бұрын

    @@Pepcoding sir phir 'public' ka kya use hota h 'public static void' me

  • @letsdoeverythinginoneweek9398

    @letsdoeverythinginoneweek9398

    3 жыл бұрын

    @@hinamankani5319 likh bhi sakta ha or nahi bhi dono ma chalega vaisa agar class public ha toh public likhna ma koi dikkat nahi ha

  • @sagarrai1282
    @sagarrai1282 Жыл бұрын

    it will not give answer for empty string

  • @vishalkushwaha5373
    @vishalkushwaha53733 жыл бұрын

    22:23 han sir mera bhi hua hai bhut baar. XD

  • @LegitGamer2345

    @LegitGamer2345

    3 жыл бұрын

    yeh hota kyu hai mere saath bhi huua hai

  • @__RohitDevar
    @__RohitDevar3 жыл бұрын

    leet code soln in cpp class Solution { public: const vector pad = { "" , "" , "abc", "def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz" }; vector letterCombinations(string digits) { if( digits.length() == 0) { vector v= {}; return v; } char c = digits[0]; vector v = letterCombinations(digits.substr(1)); string s = pad[c - '0']; vector temp; if(v.size() == 0) { for(int i=0;i

  • @amitdubey7544
    @amitdubey75443 жыл бұрын

    balti me magga magge me pani nhi hai now , ill remeber

  • @govindsinghshekhawat8533
    @govindsinghshekhawat85332 жыл бұрын

    Respect++;

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Hope you love the explanation, for better experience and well organised content visit - nados.io

  • @candyman6846
    @candyman68462 жыл бұрын

    me toh login karne se pehle back jaake code copy kar leta hu...but its really annoying har bar logout ho jata h

  • @anjneykumarsingh4461
    @anjneykumarsingh44613 жыл бұрын

    Mereko sir kccha wale p hi smjh ajata h age kyunki bdi lmbi hoti h

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    kya baat hai

  • @manishkumarprasad1911
    @manishkumarprasad19113 жыл бұрын

    balti me magga hai, magge me pani nhi hai. nice example..

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Haha..thanks buddy😋 If you like our efforts, will you like to write a few words about us here (www.quora.com/How-do-I-start-learning-or-strengthen-my-knowledge-of-data-structures-and-algorithms )

  • @manishkumarprasad1911

    @manishkumarprasad1911

    3 жыл бұрын

    SURE. Even I have shared link of pepcoding to our friend circle. thanks a lot to helping us.

  • @__RohitDevar
    @__RohitDevar3 жыл бұрын

    My fear to recursion is no more now...all Bec of sumit bhiya.....

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    I am glad you liked it. I also hope that you are watching till end and trying to understand the what, how and especially why of the problem. If you like our efforts, we request a review g.page/Pepcoding/review?rc You can subscribe to our channel here kzread.infoabout?view_as=subscriber

  • @shreeshree108panchwatidurg3
    @shreeshree108panchwatidurg33 жыл бұрын

    sir mere c++ code mey brackets and commas nahi aarhe

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Beta daal rhe hain

  • @shreeshree108panchwatidurg3

    @shreeshree108panchwatidurg3

    3 жыл бұрын

    @@Pepcoding sir error resolve hogaya aab ! Thank you

  • @shreshthdimri5685

    @shreshthdimri5685

    3 жыл бұрын

    Can you share your code

  • @tanyachhabra5537

    @tanyachhabra5537

    2 жыл бұрын

    please share your code

  • @shreeshree108panchwatidurg3

    @shreeshree108panchwatidurg3

    2 жыл бұрын

    @@tanyachhabra5537 I've already shared in the previous comment.

  • @micekey8401
    @micekey8401 Жыл бұрын

    *Code in python for reference* def kpc(arr: list, s: str) -> list: if len(s) == 0: return " " first = int(s[0]) remainingKpc = kpc(arr,s[1:]) result = [] for letter in arr[first]: for i in remainingKpc: result.append(letter+i) return result arr = [".;", "abc", "def", "ghi", "jkl", "mno", "pqrs", "tu", "vwx", "yz"] print(kpc(arr,"123"))

  • @SCRIPTSAG
    @SCRIPTSAG3 жыл бұрын

    Sir khud se nhi soch pa rhe hai question samghane pe samgh aa jata hai

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    beta foundation mei chinta na karo. level2 dsa tak thinking ban jaegi

  • @sandeeppansari2944
    @sandeeppansari2944 Жыл бұрын

    12:40

  • @shreshthdimri5685
    @shreshthdimri56853 жыл бұрын

    Koi cpp code share kardo plz 🥺

  • @shreeshree108panchwatidurg3

    @shreeshree108panchwatidurg3

    3 жыл бұрын

    krdia bhai.

  • @DreamfulGal

    @DreamfulGal

    2 жыл бұрын

    @@shreeshree108panchwatidurg3 mujhe bhi plzz

  • @saurabhjejurkar5065
    @saurabhjejurkar50652 жыл бұрын

    Leetcode problem solution: class Solution { private static String[] codes=new String []{"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; public List letterCombinations(String digits) { if(digits.length()==0){ List bans=new ArrayList(); // bans.add(""+codes[0]); return bans; } return solve(digits); } public List solve(String digits) { if(digits.length()==0){ List bans=new ArrayList(); bans.add(""); return bans; } char ch=digits.charAt(0); String ros=digits.substring(1); List res=solve(ros); List ans=new ArrayList(); String codesforch=codes[ch-'0']; for(int i=0;i

  • @tejaskadam1889
    @tejaskadam1889 Жыл бұрын

    without looking into solution i am not able to solve problems

  • @tejaskadam1889

    @tejaskadam1889

    Жыл бұрын

    started watching from first video of recursion and then able to solve it on my own

  • @raghavendrasagar5139
    @raghavendrasagar51392 жыл бұрын

    Anyone submitted this on leetcode?

  • @dheerajyadav9099
    @dheerajyadav90993 жыл бұрын

    13.34 ye kya ghatiya bat kar rahe ho😂 nice

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Hahah..ignore that beta😋

  • @anjneykumarsingh4461
    @anjneykumarsingh44613 жыл бұрын

    Kch nhi ka kuch toh kuch hi hota h (basecase)

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Haha

  • @shobhitp
    @shobhitp2 жыл бұрын

    Balti hi khali hai.......balti me mugga hai pr mugge me paani nhi hai.....Hilarious 😂

  • @Pepcoding

    @Pepcoding

    2 жыл бұрын

    Hahahaa! For much better experience check out :- nados.pepcoding.com

  • @bhatnagarcapital
    @bhatnagarcapital3 жыл бұрын

    230 likes 1 dislike

  • @Pepcoding

    @Pepcoding

    3 жыл бұрын

    Need more support from you people as this will help us in reaching out to more people and help a lot of other students as well

Келесі