402. Remove K Digits | Stack | Faang Favourite | Interview Question | C++ | Hindi

  Рет қаралды 379

Priyanshi Porwal

Priyanshi Porwal

Күн бұрын

Пікірлер: 34
@ayushisrivastava7535
@ayushisrivastava7535 6 ай бұрын
Nice explanation Liked your approach to solve the problem .
@preetu391
@preetu391 6 ай бұрын
Thank you! 😁
@shivamagarwal4005
@shivamagarwal4005 6 ай бұрын
Amazing explanation 🔥🔥
@preetu391
@preetu391 6 ай бұрын
Thank you!
@qwertyqwerty2090
@qwertyqwerty2090 6 ай бұрын
ma'am please iss question ko only ' string' se solve karke dekhiye not by stack , it will be very useful for us to develop beginner level intuition
@preetu391
@preetu391 6 ай бұрын
I did not understand, string se kaise?
@qwertyqwerty2090
@qwertyqwerty2090 6 ай бұрын
@@preetu391 ma'am stack use na karke string use kare , ek empty string le sakte h aur usme hi operation kar sakte h jo stack me liye h operations Agar aap kar degi to help hogi 🙏🙏
@preetu391
@preetu391 6 ай бұрын
​@@qwertyqwerty2090the logic there will remain the same You can use string as stack. Stack pop operation can be done using string back function
@qwertyqwerty2090
@qwertyqwerty2090 6 ай бұрын
​@@preetu391okay thanku ma'am
@UECPAPPUKUMAR
@UECPAPPUKUMAR 6 ай бұрын
neat and clean code with nice explanation Now im your subscriber ❤
@preetu391
@preetu391 6 ай бұрын
Thank you! 😊 Keep going! ✨
@pankajvishwakarma3246
@pankajvishwakarma3246 6 ай бұрын
Great Explanation 💯💯
@preetu391
@preetu391 6 ай бұрын
Thank you!
@vinaymaurya9201
@vinaymaurya9201 6 ай бұрын
Nice explanation
@preetu391
@preetu391 6 ай бұрын
Thank you!
@BadalKumar-gv3xu
@BadalKumar-gv3xu 6 ай бұрын
following you from the past 30 days and now thora bahut logic lag ja raha question mai like some test cases pass ho ja rahai btw aapnai kitnai din liyay dsa complete karnai mai??
@preetu391
@preetu391 6 ай бұрын
dsa kabhi complete nhi hota. keep practicing that's all i can say
@mohdkhaleeq7468
@mohdkhaleeq7468 6 ай бұрын
i am not able to solve daily challenge problem myself . How should i improve even i am not able to think logic how to solve and which data structure is used?
@preetu391
@preetu391 6 ай бұрын
In DSA its all about practice and patterns. Most of the problems can be solved using these patterns. So what you can do is when you solve a daily challenge without the need of seeing videos or with doesn't matter, you have to make sure you practice similar kind of pattern problems given in suggested questions or you can google also. So it helps you build an intuition and when again the same pattern problem will be there you will be able to atleast approach the problem with some logic. At the end of the day everything boils down to consistent practice.
@nehulbhamare3412
@nehulbhamare3412 6 ай бұрын
How would we have solved the question if consecutive k digits would be removed? In O(n) time complexity
@preetu391
@preetu391 6 ай бұрын
When consecutive digits have to be removed then it essentially will be a substring problem, in that case fixed size sliding window could be used.
@nehulbhamare3412
@nehulbhamare3412 6 ай бұрын
But how to solve in O(n) , because substr function will tak O(n) time so O(n^2) time complexity
@nehulbhamare3412
@nehulbhamare3412 6 ай бұрын
Can you give the code? How to solve it?
@preetu391
@preetu391 6 ай бұрын
@@nehulbhamare3412 we don't need to use substr. Please see a tutorial on sliding window, you will get it.
@preetu391
@preetu391 6 ай бұрын
@@nehulbhamare3412 Google fixed size sliding window
@Ashwinmahajan-ld6qt
@Ashwinmahajan-ld6qt 6 ай бұрын
in example 1 what if we remove 432 and after interchanging digits we are getting smallest digit as '1129' can you explain this please
@preetu391
@preetu391 6 ай бұрын
That's what we have removed and got 1219 You can't change the order of digits
@Ashwinmahajan-ld6qt
@Ashwinmahajan-ld6qt 6 ай бұрын
@@preetu391 okay !! so we cant change order of digits...then why to consider the factorial ways as factorials we can get by rearranging order... can you please explain that?
@preetu391
@preetu391 6 ай бұрын
@@Ashwinmahajan-ld6qt If you listen in the beginning I have said we can't change the order. Factorial ways I had only shown to highlight the intuition that when numbers are in increasing order we are sure to get smallest possible number only. There also I have told that we have to do the same that is to find an increasing sequence to reach as close to it as we can. Otherwise won't the problem be too easy, just sort the string and get the answer.
@Ashwinmahajan-ld6qt
@Ashwinmahajan-ld6qt 6 ай бұрын
@@preetu391 thanks
@tahavirdiwala4881
@tahavirdiwala4881 6 ай бұрын
Can we get codeforces?
@preetu391
@preetu391 6 ай бұрын
Hi! Codeforces editorials you can find on coding75.com
@hiteshpatwal9688
@hiteshpatwal9688 6 ай бұрын
Why I am getting MLE 🤐🤐🤐🤐🤐🤐on the last test case
@preetu391
@preetu391 6 ай бұрын
I too did in my first submission. Don't really know why but I'll revert back if I find out
CSS Tutorial for Beginners | Complete CSS with Project, Notes & Code
7:18:24
Every parent is like this ❤️💚💚💜💙
00:10
Like Asiya
Рет қаралды 26 МЛН
Миллионер | 2 - серия
16:04
Million Show
Рет қаралды 1,3 МЛН
Lecture 59: Design Special Stack Problem || C++ Placement Course
29:29
CodeHelp - by Babbar
Рет қаралды 108 М.
514. Freedom Trail | Recursion - Memoization - DP | C++ | Hindi
23:57
WHY IS THE STACK SO FAST?
13:46
Core Dumped
Рет қаралды 160 М.
Add Two Numbers | Facebook Interview Question | Linked List | LeetCode 2 | C++
6:09
Programming With Niladree - PWN - Bangladesh
Рет қаралды 2
My 10 “Clean” Code Principles (Start These Now)
15:12
Conner Ardman
Рет қаралды 246 М.
Viral Video of a Man's Crazy Job Interview
16:02
Darryl Vega TV
Рет қаралды 1,3 МЛН
If Your Tech Job is Comfortable, You're in Danger
20:57
Thriving Technologist
Рет қаралды 19 М.
All useEffect Mistakes Every Junior React Developer Makes
22:23
10 New JS Features You Should Know About
4:22
Awesome
Рет қаралды 14 М.