995, 3191, 3192 Minimum Number of K Consecutive Bit Flips | Bit Manipulation | Sliding Wind | Greedy
In this video, I'll talk about how to solve Leetcode 995. Minimum Number of K Consecutive Bit Flips | Bit Manipulation | Prefix Technique | 3191. Minimum Operations to Make Binary Array Elements Equal to One I | 3192. Minimum Operations to Make Binary Array Elements Equal to One II
BIT MANIPULATION Crash Course 📈 | All Tricks & Pattern with Intuition for DSA & CP - • BIT MANIPULATION Crash...
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
0:00 - Bakwas
1:00 - Leetcode 3191. Minimum Operations to Make Binary Array Elements Equal to One
7:18 - Leetcode 3192. Minimum Operations to Make Binary Array Elements Equal to One II
15:56 - Leetcode 995. Minimum Number of K Consecutive Bit Flips
18:41 - (Explanation & Dry Run)
26:40 - Code Explanation (O(n) space)
29:42 - O(1) space
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms
Пікірлер: 60
Added Time Stamps too for the folks who want to jump directly Leetcode 995 or Space Optimized version of Leetcode 995 ❤, do comment down below what you guys missed while you were solving from your end & wasn't able to solve it 🫡
@chakri6262
Ай бұрын
Did same as changing the indices according to k value as problem 3191 but got TLE at 104 testcase now it got cleared thank you. Great work in covering the variants and approach
@priyanshkumariitd
Ай бұрын
I figured out that 'times' has to reset it's value once I cross the subarray length of k (19:43)
Bhaiya chumma explanation... u r literally the GOAT...
bruhhh!!! mind blowing explanation...seriously the bestttttt
Loved the way explanation ❤ And covered 3 questions in one video 🔥
Loved the 3191 and 3192 bit in the beginning to boil down to 995.
pehele neetcode dekh ke idhar ata tha, ab direct yahi ata hu
@akmarkan2490
Ай бұрын
🤣🤣
@srikrishnabejawada3126
Ай бұрын
haha.... Egjactlee...
Great work in explaining the approach!
great content......now i get why this guy is a gold medalist in NIT
Q 3191,3192 from Biweekly leetcode contest
Thank you Aryan for explaining it so well. It helps a lot man.
today i learned how to use inputs for our advantage, and also learned the beautiful technique of flipping of bits without actually flipping them, but by just knowing the fact that "a bit flipped even times will remain same and flipping it odd times will change it". thanks aryan bhaiya
great aryan bhai .... bss tumhara hi sahara h ab to
bhai ky solution solution banaya hai puri ytube par itna bdia solution nhi mila hats off to you 90 days streak completed becoz of your solutions please keep postiong more and more amazing content
Thanks for explaining with variations of the same problem.
24:04 Hits hard tho ! Have to move on
@dhruvchopra26
Ай бұрын
😂😂
@Deadinside567
Ай бұрын
Nice explanation, Good that you are accounting similar problems and solving them too!
absolutely loved your explanation and the consistent uploads. its baffling how you don't have more audience, wishing you all the very best! and thanks alot!
Awesome explanation, perfectly described, you got a new subscriber!
Great Explanation! Although I think that still it's a bit tricky to implement if you don't know it already.
Great Aryan bhai thanks for taking effort in bringing all the linked topics together That's great . I would wish to know how such ideas generate like of keeping times variable and space to O(1) . That's Really 😎😎
Excellent explanation Aryan, the way you teach is simply superb. Hats-off to you for investing your time in creating such useful content. The way you explained the related problems made this question easy to comprehend. Keep up the great work bro !!
great explanation bro helped a lot thank you
learnt a lot of optimisations
Great explanation!
Great explanation!!
Thank you bro You are genius.
Excellent explanation! ❤
nice explanation bhaiya
thanks a lot maahn
nice explanation thanks a lot
wonderful explanation❤🔥❤🔥
Contest ke questions Bhi saath mein ho gaye
Great explanation bro
Thanks
nice one..
In the last part of O(1) SPACE you can also make nums[i]=2 if you flipped ith bit and while rechecking just see if it is 2, if it is 2 it means it is responsible for flipping.
bro I have been doing this for so long time but still Can't improve or come up with such type of solution what should I do and I always stuck with things with simple logic such as permuation and combination , number theory or bit manipulation what should I do .
@dhruvchopra26
Ай бұрын
Practice more topicwise questions of medium difficulty level. Try doing Codeforces too. Then once you are familiar or comfortable with a topic,pickup random problems(the ones you don't know the topic of) and try solving them. Slowly with more practice,you'll begin to identify patterns and will intuitively know what algorithm or method or data structure to use. Don't worry,just keep practicing and don't give up!!
@omkarjadhav6183
Ай бұрын
@@dhruvchopra26 will do that
a doubt: changing the input array (making element = 2) will still count as O(n) space, how/why?
3 variants of flip bits leetcode learnt
1st two was coming in this Biweekly Contest...
Tu bhai hai mera
🙏🙏
🤟
hey aryan i faced difficulty to solve todays POTD i was worried, is it normal to be like this?
@kandariarjun
Ай бұрын
its completely normal and its better as you'll learn new concepts and approaches...
Add title.. biweekly Saturday contest questions 😂❤
Can Someone pls explain the -1 case again?
Bro 4th question kahan hai?
makshad bhoolna nahi hai was personal💀
ur past not sorted😂
Can you try to explain your dry runs in a more concise manner? I feel like you are trying to spoon-feed the logic which makes the explanation unnecessarily difficult to understand.
good explanation