3229. Minimum Operations to Make Array Equal to Target | Greedy | With Proof

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ต.ค. 2024

ความคิดเห็น • 19

  • @_sf_editz1870
    @_sf_editz1870 3 หลายเดือนก่อน +3

    The Approach is very good and intutive aryan

  • @uncutengineer2797
    @uncutengineer2797 3 หลายเดือนก่อน +1

    your explaination is really really good aryan bro

  • @InWonderland-z2l
    @InWonderland-z2l 3 หลายเดือนก่อน +2

    was so elated to see that you've put out a video for today's contest :)
    by the way, will you be doing the second problem (vowels game in a string) for this contest as well?
    i had doubts in it and the way you tackle every little edge case and condition is amazing

    • @monilcharola6873
      @monilcharola6873 3 หลายเดือนก่อน

      Bro it;s greedy.
      See, Alice will go first. Consider that in a game each player, plays for itself and in the optimal case they will try to make their opponents loose.
      Case 1 :
      There are no vowels. (:( Alice cannot take anything thus Alice is defeated)
      Case 2 : There are either odd or even number of vowels
      -> If odd (Since Alice wants to defeat Bob, she takes the substring containing all the vowels thus leaving 0 vowels for BOB ) Alice wins
      -> If even (ALICE want's to win by defeating BOB, here also she takes substring containing odd number of vowels, leaving only 1 vowel for BOB) thus Bob won't have even vowels to pick, here also Alice wins!!
      CODE :
      I vowel count == 0, BOB wins
      Else ALICE winds
      PS : Alice is a bitch!!!!!!!!😂

  • @monilcharola6873
    @monilcharola6873 3 หลายเดือนก่อน

    JUST BRILLIANT !!!!!!!!!!!!!!!!!!!!!!

  • @asthajain2511
    @asthajain2511 3 หลายเดือนก่อน +1

    aryan bhai op🫡

  • @ajayprabhu465
    @ajayprabhu465 3 หลายเดือนก่อน

    ha ha, was waiting for this itself

  • @sanchitdeepsingh9663
    @sanchitdeepsingh9663 3 หลายเดือนก่อน

    thanks

  • @ITACH1688
    @ITACH1688 3 หลายเดือนก่อน

    kya hi chumma explanation hai 😳

  • @nooob_coder
    @nooob_coder 3 หลายเดือนก่อน

    wow i can think like this ?

  • @23cash86
    @23cash86 3 หลายเดือนก่อน +1

    I had figured everything till 19:00 , I was blank aftermath

  • @abhinavnarula7300
    @abhinavnarula7300 3 หลายเดือนก่อน

    At 1:47 won't we require 3 ops instead of 2? I am confused on that part. Can someone pls clarify

  • @nikhilsoni2403
    @nikhilsoni2403 3 หลายเดือนก่อน +5

    Bhai saturday ke contest ka 4th problem ka solution upload karo na 😂😂

    • @prajitbanerjee8226
      @prajitbanerjee8226 3 หลายเดือนก่อน +1

      LOL bro

    • @satwiktatikonda764
      @satwiktatikonda764 3 หลายเดือนก่อน +1

      why
      is it that difficult?

    • @monilcharola6873
      @monilcharola6873 3 หลายเดือนก่อน

      @@satwiktatikonda764 Bro only 69 people were able to solve it

  • @sangdilbiswal30
    @sangdilbiswal30 3 หลายเดือนก่อน

    I almost figured it out but time was done😅

  • @hrudaytej2133
    @hrudaytej2133 3 หลายเดือนก่อน

    how tf am i supposed to come up with this in contest?