7. Subsequences, Power Set using Recursion Code - Practise with me, understand code in detail! 🚀🔥

  Рет қаралды 6,658

Code From Scratch - Keerti Purswani

Code From Scratch - Keerti Purswani

Күн бұрын

Пікірлер: 58
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
How does it feel to solve medium level recursion questions? ❤️
@cricketguru7596
@cricketguru7596 2 жыл бұрын
Visualization of recursive tree was little difficult? Having a high hope, after going through this series i will be more comfortable
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
@@cricketguru7596 let me know if you have any doubts. M here. You just watch the videos properly!
@cricketguru7596
@cricketguru7596 2 жыл бұрын
@@codefromscratch-keertipurswani yes sure
@Nishchay-kc1gb
@Nishchay-kc1gb 2 жыл бұрын
Now i am understanding more clearly and speed has increased a bit
@yuv09
@yuv09 2 жыл бұрын
The question is rated easy, but it seems like hard one 😅😅😅
@unknowncoder409
@unknowncoder409 2 жыл бұрын
Yes the second catch was that we had to remove the empty string from the resultant vector as it is asked in the problem statement. Thank you Mam for great teaching!!!
@sameer9368
@sameer9368 2 жыл бұрын
Since I am your senior experience wise... I always follow your video the way you provide detail explanation...please keep motivating us
@Hustle_bussle
@Hustle_bussle 2 жыл бұрын
I hope I can explain every DSA concept as easily as you do!!Looking forward to that day✌🤞
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
You will be able to! I am so sure ❤️
@saurabhbera4833
@saurabhbera4833 2 жыл бұрын
I used to get scared using recursion. But these days I think recursion is fun it's all about recursive faith😂❤️
@rajinderkaur7658
@rajinderkaur7658 2 жыл бұрын
Great explanation mam👌gaining confidence day by day only because of you💪thankyou❤more power to you❤❤❤
@arjunyadav-kt5jr
@arjunyadav-kt5jr 2 жыл бұрын
i could figure out the second catch easily, because keerti does not let us forget anything!!
@swathijaishetty460
@swathijaishetty460 2 жыл бұрын
Thanks for putting so much of efforts, to make us understand clearly :)
@MdRizwan-uu9dv
@MdRizwan-uu9dv 2 жыл бұрын
Thankyou didi for this wonderful explanation👌👍👌👍👌
@bharanisrianbalagan1924
@bharanisrianbalagan1924 2 жыл бұрын
such a nice explanation ever
@prakashbtw678
@prakashbtw678 2 жыл бұрын
I have been waiting for this. Thank you thank you
@nidhikumari1479
@nidhikumari1479 2 жыл бұрын
Thank you so much mam! Solving a medium level rec. ques. feels great.👍
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
Yaaaay. Awesome Nidhi!
@simranvolunesia
@simranvolunesia 2 жыл бұрын
SUMMARY ============================= Write code for including character and excluding character Push "curr_subsequence" to "ans" when curr_idx == n Another way to remove the empty string from "ans" is to pop_back before sorting REASON: empty string will always be added to "ans" at last only Alternative code class Solution{ public: void helper(string s, int curr_idx, int n, string curr_subsequence, vector &ans){ if(curr_idx == n){ ans.push_back(curr_subsequence); return; } // include character helper(s,curr_idx+1,n,curr_subsequence+s[curr_idx],ans); // not include character helper(s,curr_idx+1,n,curr_subsequence,ans); } vector AllPossibleStrings(string s){ vector ans; helper(s,0,s.length(),"",ans); ans.pop_back(); // remove empty string sort(ans.begin(),ans.end()); return ans; } };
@MaheshBabuGurram
@MaheshBabuGurram 2 жыл бұрын
Hi Keerthi, These videos are really helpful. I have shared it with my friend and they subscribed to the channel. One suggestion, could you discuss time and space complexity for each of the problems that you are covering?
@muthukumara8792
@muthukumara8792 3 ай бұрын
Given a collection of candidate numbers (candidates) and a target number (target), find all unique combinations in candidates where the candidate numbers sum to target. Each number in candidates may only be used once in the combination. mam could you make a video to solve this?
@rtarts1524
@rtarts1524 2 жыл бұрын
Thank You Mam..
@jasmindersingh6708
@jasmindersingh6708 2 жыл бұрын
We found 8 number of subsequences but they ask for only 7 subsequences. The extra one is empty (" ").
@nidhibansaliitr
@nidhibansaliitr 2 жыл бұрын
I wrote it like a mix of iterative + recursive manner. Please share your view point on the code. void helper(List list, String s, String sChar, int total, int counter){ char [] charArray = s.toCharArray(); if(!list.isEmpty()){ int size = list.size(); for(int i =0; i
@paraschauhan4466
@paraschauhan4466 2 жыл бұрын
I also write dii current . length is greater than zero than res.pushbackcurrent
@ashwinisunilchoudhari9660
@ashwinisunilchoudhari9660 2 жыл бұрын
I have one doubt mam , after include helper get executed one time ,the next exclude helper should get executed.? but in explanation according to my understanding after first helper reached to n , base condition is executing and then exclude helper.
@prashanthiaruna8501
@prashanthiaruna8501 2 жыл бұрын
Am still in binary search only i practice in weekends as I don have time is this normal to be this slow ??
@GauravKumar-by1yt
@GauravKumar-by1yt 2 жыл бұрын
Thank you
@JardaniJovonovich192
@JardaniJovonovich192 2 жыл бұрын
Thanks for the video. In GFG, it is mentioned that the expected space complexity is O(n*2^n). Shouldn't the SC be just O(2^n) ?
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
Will cover this in a youtube short tomorrow. Should have talked about it. Thanks for pointing it out ❤️
@div0007
@div0007 2 жыл бұрын
Think of SC as an array of array, where total elems in the outer array are 2^N and each element(which is also an array of char aka string) can have max length of N. so SC will be size each elem * number of elems or O(N*2^N)
@nidhibansaliitr
@nidhibansaliitr 2 жыл бұрын
I was able to write code by myself. But your code is always more crisp.
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
Hi Nidhi, could you please drop a mail (just a hi would do) at workwithkeertipurswani@gmail.com
@jagdishkumawat2738
@jagdishkumawat2738 2 жыл бұрын
💯🔥
@ShubhamSingh-gk8vp
@ShubhamSingh-gk8vp 2 жыл бұрын
let goooo !!
@ashwaniarchivee
@ashwaniarchivee 2 жыл бұрын
Present ma'am.
@deepchill5295
@deepchill5295 2 жыл бұрын
Day 19- present 🙋‍♂️
@mohdhaseeb9818
@mohdhaseeb9818 2 жыл бұрын
Present Ma'am
@nithishnair6265
@nithishnair6265 2 жыл бұрын
Present 👍
@hackerIfeelYou
@hackerIfeelYou 2 жыл бұрын
Present ma'am 🤞
@cricketguru7596
@cricketguru7596 2 жыл бұрын
Present 🔥
@vigneshiyer1765
@vigneshiyer1765 2 жыл бұрын
Present mam!!
@myth__un
@myth__un 2 жыл бұрын
Present ma'am
@devilnk8475
@devilnk8475 2 жыл бұрын
Didi ...plz live stream ...
@codefromscratch-keertipurswani
@codefromscratch-keertipurswani 2 жыл бұрын
What should we discuss in live stream? Anything specific in mind?
@devilnk8475
@devilnk8475 2 жыл бұрын
@@codefromscratch-keertipurswani 'Mam' if we have any doubts ask in live stream and we connect to directly...🥰🥰
@surojitsantra7627
@surojitsantra7627 2 жыл бұрын
🙋
@Nishchay-kc1gb
@Nishchay-kc1gb 2 жыл бұрын
I am solving
@varunendra.singh_
@varunendra.singh_ 2 жыл бұрын
Day 19🙋
@VishalYadav-vt4cw
@VishalYadav-vt4cw 2 жыл бұрын
🙋‍♂️
@learner7940
@learner7940 Жыл бұрын
Did anyone do this in JS ?
@utkarshawasthi1665
@utkarshawasthi1665 2 жыл бұрын
Coding Prac Day 7 V3
@sravantipris3544
@sravantipris3544 Жыл бұрын
good
@sachinaghera8189
@sachinaghera8189 2 жыл бұрын
Present
@arunkumarmohandas4420
@arunkumarmohandas4420 2 жыл бұрын
Present
8. Find Subsets - Can you understand the variation from subsequences code? Understand details 🔥🚀
13:03
9. String Permutations Code using Recursion & Backtracking! Simple Explanation 💪🚀🔥
17:12
Code From Scratch - Keerti Purswani
Рет қаралды 4,5 М.
World’s strongest WOMAN vs regular GIRLS
00:56
A4
Рет қаралды 39 МЛН
Motorbike Smashes Into Porsche! 😱
00:15
Caters Clips
Рет қаралды 23 МЛН
Subsets | LeetCode 78 | C++, Java, Python | Power Set
27:15
Knowledge Center
Рет қаралды 29 М.
Lecture37: Recursion - Subsets / Subsequences of String [Theory + Code]
27:25
CodeHelp - by Babbar
Рет қаралды 330 М.
11. Generate Parantheses | The recursion question that I have asked the most in interviews! 🚀🚀
15:30
How to Understand Any Recursive Code
16:53
Byte by Byte
Рет қаралды 150 М.
Let's solve this LIVE | Rat in a Maze | Become Master in Recursion | Practise with me!!
14:59
Code From Scratch - Keerti Purswani
Рет қаралды 1,6 М.
Recursion Subset, Subsequence, String Questions
1:23:56
Kunal Kushwaha
Рет қаралды 328 М.
How to Generate All Subsets of a Set | A Step-by-Step Guide | Recursion
34:11
Programming Pathshala
Рет қаралды 15 М.
Power Set | Print all Subsequences
9:56
take U forward
Рет қаралды 171 М.