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

  • @ARYANMITTAL
    @ARYANMITTALАй бұрын

    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

    @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

    @priyanshkumariitd

    Ай бұрын

    I figured out that 'times' has to reset it's value once I cross the subarray length of k (19:43)

  • @ITACH1688
    @ITACH1688Ай бұрын

    Bhaiya chumma explanation... u r literally the GOAT...

  • @adarshjain3058
    @adarshjain3058Ай бұрын

    bruhhh!!! mind blowing explanation...seriously the bestttttt

  • @adityadalve2467
    @adityadalve2467Ай бұрын

    Loved the way explanation ❤ And covered 3 questions in one video 🔥

  • @edocdrah
    @edocdrahАй бұрын

    Loved the 3191 and 3192 bit in the beginning to boil down to 995.

  • @ajayprabhu465
    @ajayprabhu465Ай бұрын

    pehele neetcode dekh ke idhar ata tha, ab direct yahi ata hu

  • @akmarkan2490

    @akmarkan2490

    Ай бұрын

    🤣🤣

  • @srikrishnabejawada3126

    @srikrishnabejawada3126

    Ай бұрын

    haha.... Egjactlee...

  • @tapanavasthi
    @tapanavasthiАй бұрын

    Great work in explaining the approach!

  • @mohammedansil2302
    @mohammedansil2302Ай бұрын

    great content......now i get why this guy is a gold medalist in NIT

  • @sumitgupta310
    @sumitgupta310Ай бұрын

    Q 3191,3192 from Biweekly leetcode contest

  • @dewanshpatle9056
    @dewanshpatle9056Ай бұрын

    Thank you Aryan for explaining it so well. It helps a lot man.

  • @asmitshukla4649
    @asmitshukla4649Ай бұрын

    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

  • @ashutoshnautiyal3372
    @ashutoshnautiyal337227 күн бұрын

    great aryan bhai .... bss tumhara hi sahara h ab to

  • @mukulkhanna26
    @mukulkhanna2629 күн бұрын

    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

  • @nikhilbabar2226
    @nikhilbabar2226Ай бұрын

    Thanks for explaining with variations of the same problem.

  • @Nomesh25
    @Nomesh25Ай бұрын

    24:04 Hits hard tho ! Have to move on

  • @dhruvchopra26

    @dhruvchopra26

    Ай бұрын

    😂😂

  • @Deadinside567

    @Deadinside567

    Ай бұрын

  • @Jenisha-tv2mi
    @Jenisha-tv2miАй бұрын

    Nice explanation, Good that you are accounting similar problems and solving them too!

  • @Zomb-zj4ip
    @Zomb-zj4ipАй бұрын

    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!

  • @maximusvick2572
    @maximusvick257226 күн бұрын

    Awesome explanation, perfectly described, you got a new subscriber!

  • @shiveshanand5812
    @shiveshanand5812Ай бұрын

    Great Explanation! Although I think that still it's a bit tricky to implement if you don't know it already.

  • @MVK7210
    @MVK7210Ай бұрын

    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 😎😎

  • @vineethm6930
    @vineethm6930Ай бұрын

    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 !!

  • @aniketbharane
    @aniketbharaneАй бұрын

    great explanation bro helped a lot thank you

  • @SurajGupta-gc9tz
    @SurajGupta-gc9tz28 күн бұрын

    learnt a lot of optimisations

  • @abhishektripathi3904
    @abhishektripathi3904Ай бұрын

    Great explanation!

  • @techyguy7776
    @techyguy7776Ай бұрын

    Great explanation!!

  • @anushkachouhan5996
    @anushkachouhan5996Ай бұрын

    Thank you bro You are genius.

  • @Sanjay-xq5xr
    @Sanjay-xq5xrАй бұрын

    Excellent explanation! ❤

  • @namannema3349
    @namannema3349Ай бұрын

    nice explanation bhaiya

  • @sidharthanp1551
    @sidharthanp1551Ай бұрын

    thanks a lot maahn

  • @shwetank00
    @shwetank00Ай бұрын

    nice explanation thanks a lot

  • @vijayanks1714
    @vijayanks1714Ай бұрын

    wonderful explanation❤‍🔥❤‍🔥

  • @ashishmohapatra8588
    @ashishmohapatra8588Ай бұрын

    Contest ke questions Bhi saath mein ho gaye

  • @sagaragrawal6315
    @sagaragrawal6315Ай бұрын

    Great explanation bro

  • @jk-sm6qr
    @jk-sm6qrАй бұрын

    Thanks

  • @naamnhibataunga5897
    @naamnhibataunga5897Ай бұрын

    nice one..

  • @stephenh7788
    @stephenh7788Ай бұрын

    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.

  • @omkarjadhav6183
    @omkarjadhav6183Ай бұрын

    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

    @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

    @omkarjadhav6183

    Ай бұрын

    @@dhruvchopra26 will do that

  • @TarunParmar-o9i
    @TarunParmar-o9iАй бұрын

    a doubt: changing the input array (making element = 2) will still count as O(n) space, how/why?

  • @youcanyouwill2004
    @youcanyouwill200426 күн бұрын

    3 variants of flip bits leetcode learnt

  • @mohit7717
    @mohit7717Ай бұрын

    1st two was coming in this Biweekly Contest...

  • @rohitkumarpilania94
    @rohitkumarpilania94Ай бұрын

    Tu bhai hai mera

  • @RohitKumar-hn6wj
    @RohitKumar-hn6wjАй бұрын

    🙏🙏

  • @hrithikgoswami9808
    @hrithikgoswami9808Ай бұрын

    🤟

  • @madmaxgaming5864
    @madmaxgaming5864Ай бұрын

    hey aryan i faced difficulty to solve todays POTD i was worried, is it normal to be like this?

  • @kandariarjun

    @kandariarjun

    Ай бұрын

    its completely normal and its better as you'll learn new concepts and approaches...

  • @mind_blazed
    @mind_blazedАй бұрын

    Add title.. biweekly Saturday contest questions 😂❤

  • @abhinavnarula7300
    @abhinavnarula7300Ай бұрын

    Can Someone pls explain the -1 case again?

  • @GYANKIBAAT-ze7nd
    @GYANKIBAAT-ze7ndАй бұрын

    Bro 4th question kahan hai?

  • @adarshjain3058
    @adarshjain3058Ай бұрын

    makshad bhoolna nahi hai was personal💀

  • @tarungupta8668
    @tarungupta8668Ай бұрын

    ur past not sorted😂

  • @devt4072
    @devt4072Ай бұрын

    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.

  • @MATTUPALLINVSGKESAVAKUMARBCE
    @MATTUPALLINVSGKESAVAKUMARBCEАй бұрын

    good explanation