Leetcode | Biweekly Contest 133 | B | C | D | 3191 | 3192 | 3193 | Editorial | Detailed Solution.

Leetcode | Biweekly Contest 133 | B | C | D | 3191 | 3192 | 3193 | Editorial | Detailed Solution.
B Solution : leetcode.com/contest/biweekly...
C Solution : leetcode.com/submissions/deta...
D Solution : leetcode.com/submissions/deta...
Biweekly Contest 133
B
C
D
3191
3192
3193
3193. Count the Number of Inversions
3191. Minimum Operations to Make Binary Array Elements Equal to One I
3192. Minimum Operations to Make Binary Array Elements Equal to One II
#133
#Biweekly Contest 133
#B
#C
#D
#3191
#3192
#3193
#Count the Number of Inversions
#Minimum Operations to Make Binary Array Elements Equal to One I
#Minimum Operations to Make Binary Array Elements Equal to One II
#inversion
#leetcode
#3176
#3177
#BiweeklyContest
#132
#dp
#segmenttree
#lazypropogation
#hindisolution
#ProgrammingTutorial
#AlgorithmExplanation
#StringManipulation
#codinginhindi
#dynamicprogramming
#CodeChefContest
#problemsolving
#BinaryStrings
#programminginhindi
#CompetitiveProgrammingTutorial
#AlgorithmExplanationInHindi
#StringManipulationTutorial
#codingtutorial
#HindiCodingTutorial
#CodeChefContest
#problemsolving
#BinaryStrings
#programminginhindi
#CompetitiveProgrammingTutorial
#AlgorithmExplanationInHindi
#StringManipulationTutorial
#codingtutorial
#HindiCodingTutorial
#algorithmanalysis
#programminglogic
#problemsolvingtechniques
#StringManipulationTechniques
#codeexplanation
#HindiProgrammingTutorial
#codingtips
#programmingeducation
#OnlineProgrammingContest
#ProgrammingSkills
#computersciencetutorial
00:00 Problem B
09:17 Problem C
15:33 Problem D

Пікірлер: 67

  • @MdAlAmin-bz7uh
    @MdAlAmin-bz7uh4 күн бұрын

    Best explanation. Love from Bangladesh

  • @pretestpassed157

    @pretestpassed157

    4 күн бұрын

    Thankyou ❤️

  • @anshumaan1024
    @anshumaan10246 күн бұрын

    B aur C problem boht hi mast tha, although mere se hua nhi tha.. 🥲 btw tumne boht acha explain kia , nice.🙂

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou Brother.

  • @akshanshsharma6025
    @akshanshsharma60254 күн бұрын

    Bhai rukna nahi chaiye tutorials kya mst explain Kiya tune 🔥🔥🔥👑👑

  • @pretestpassed157

    @pretestpassed157

    4 күн бұрын

    Thankyou ❤️

  • @closer9689
    @closer96896 күн бұрын

    What a simple and subtle explanation!!🤌🙏.....Aapp jis tarah se aasan words use krte ho to explain is just too good!!

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou ❤️

  • @saitejachebolu4798
    @saitejachebolu47986 күн бұрын

    The final question explanation was fantastic

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @anshumaan1024
    @anshumaan10246 күн бұрын

    nice video. I have already seen your video someday. Now I am again watching you. Plus tum codechef ke bhi soln btate ho. Lgta hai subscribe krna hi padega. hmm..

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @closer9689
    @closer96896 күн бұрын

    Bhaiya please continue posting contest solution....Your explanation is very good....🙏

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Sure. Whenever I will get time I will upload the editorial.

  • @Abhi-zr1pb
    @Abhi-zr1pb6 күн бұрын

    bahut badiya bhaiya '

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @codecodecode1752
    @codecodecode17526 күн бұрын

    good explanation

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @NeverGive-Up..26
    @NeverGive-Up..266 күн бұрын

    Nicely explained

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @priyanshvatsal9791
    @priyanshvatsal97916 күн бұрын

    Thanks, Brother 😇

  • @Abhi-zr1pb
    @Abhi-zr1pb6 күн бұрын

    int pre=0; // var to indicate number of changes happen to an element for(int i=0;i

  • @manishukla7164
    @manishukla71646 күн бұрын

    what a brilliant explanation for 4th one

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @closer9689
    @closer96896 күн бұрын

    I coded it myself after the explanation!😁 Code:- class Solution { public: int minOperations(vector& nums) { int count = 0; int n = nums.size(); for(int i = 0 ; i { if(count%2 == 0) //even { if(nums[i] == 0) { count++; } } else { if(nums[i] == 1) { count++; } } } return count; } };

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Nice

  • @anshumaan1024

    @anshumaan1024

    6 күн бұрын

    nice, mene bhi same code kia hai

  • @closer9689

    @closer9689

    6 күн бұрын

    @@anshumaan1024 Thanks! Good to know😇

  • @adityathakur8695
    @adityathakur86956 күн бұрын

    bhaiya op

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @rv5778
    @rv57786 күн бұрын

    Best editorial . Please keep making such videos.

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Sure, Thankyou

  • @OmKumar-co8iz
    @OmKumar-co8iz6 күн бұрын

    Thanks 🎉

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @ghoshalsingh7535
    @ghoshalsingh75356 күн бұрын

    for problem C my approach by observation i do that i will the number of pairs in array like 0000...000 make 1 pair and 111..11 make 1 pair the toatal numbers of pairs that are found in arraay is our answer if you don't understand see my code below class Solution { public: int minOperations(vector& nums) { int i=0; int n=nums.size(); while(i

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Nice approach.

  • @_anteikuu_2400
    @_anteikuu_24006 күн бұрын

    Thanks bro.....awesome explainations!

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @priyanshkumariitd
    @priyanshkumariitd6 күн бұрын

    Thanks for this editorial!!

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @professorop5994
    @professorop59946 күн бұрын

    Nice explanation from your end 😅

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @gyanikumari4973
    @gyanikumari49736 күн бұрын

    What an explanation 🔥🔥

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @closer9689
    @closer96896 күн бұрын

    You gained a new subscriber 😇

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou

  • @Sameer-sl2qn
    @Sameer-sl2qn4 күн бұрын

    Bhaiya aap bahut accha samjhate ho , dp kaise strong karein ek bar vo bhi bata do

  • @reactcode9148
    @reactcode91486 күн бұрын

    Thanks for sharing

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thanks

  • @TonyStark-xt2bo
    @TonyStark-xt2bo4 сағат бұрын

    Please use dark mode 🙌

  • @crazymemes4080
    @crazymemes40806 күн бұрын

    1 request bro :) PLEASE Don't join TLE ELIMINATORS you are best in explaning the problem :)

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Thankyou ❤️

  • @amanasrani6405
    @amanasrani64054 күн бұрын

    Hello, In the C question, why we ware not taking the case when it is not possible to convert all the elements into 1?

  • @techyguy7776
    @techyguy77764 күн бұрын

    Thanks for the editorial, your code fails on test case n = 3 and requ: [[2,2],[0,1]] for D problem I have even copy pasted your code in leetcode to confirm this, we need to update the base condition for this to so that we check inv count at zeroth index if(idx == 0) { if(inv == 0) { if(req[idx] != -1 and inv != req[idx]) { return 0; } return 1; } else { return 0; } }

  • @pretestpassed157

    @pretestpassed157

    3 күн бұрын

    Actually, I thought the tc must be generated such that for 0th index the number of inversions must be 0. By the way thanks for reminding me, I have updated the final solution.

  • @__topgun_1034
    @__topgun_10346 күн бұрын

    In first question You didn't explain how the approach you told will give minimum number of flips always ?

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    As in the problem we have to figure out the minimum number of operations so I have iterated it from left to right and I explained the reason behind iterating it from left to right, that was only the method to approach this kind of problem.

  • @TarunSantani
    @TarunSantani5 күн бұрын

    4th nhi samjha wapas dekhta dry run krta but kuch ho samjhne ke liye toh batao inversionreq is for what inversion required at that index ideally to be valid or inversion required in requirements

  • @pretestpassed157

    @pretestpassed157

    5 күн бұрын

    For the given index inversion required in requirement.

  • @TarunSantani

    @TarunSantani

    5 күн бұрын

    @@pretestpassed157 so if there are 5 elements then case of requirements as (4,2),(3,3) doesnot exist ???

  • @TarunSantani

    @TarunSantani

    5 күн бұрын

    @@pretestpassed157 also if at 5 we are required 3 and 4 doesnot required anything that is 4 is -1 so while we are running recursion loop we set 4,3 then 4,2 then 4,1 and 4,0 isn't it wrong as if 5 requires 3 we still have greater options of inversion i.e more permutation as u mentioned at 4 we have (0,1,2,3,4) possibilities of inversions ...

  • @pretestpassed157

    @pretestpassed157

    5 күн бұрын

    No because agr index 3 pr 3 inversion h to index 4 pr to usse equal ya bada hi hoga na

  • @TarunSantani

    @TarunSantani

    5 күн бұрын

    thanks alot i think i got it

  • @Abhi-zr1pb
    @Abhi-zr1pb6 күн бұрын

    par bahiya -1 wla case to handle hi nahi kiya ?

  • @pretestpassed157

    @pretestpassed157

    6 күн бұрын

    Are you talking about the problem B?

  • @udaykirankorada1771
    @udaykirankorada17716 күн бұрын

    Bhaiya try to speak much in English

  • @anshumaan1024

    @anshumaan1024

    6 күн бұрын

    nhi vro hindi hi bolo..hindi me feel hai joh english me nhi.. ! english ka choda mt bano pls english intw me jadhna

Келесі