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
Best explanation. Love from Bangladesh
@pretestpassed157
4 күн бұрын
Thankyou ❤️
B aur C problem boht hi mast tha, although mere se hua nhi tha.. 🥲 btw tumne boht acha explain kia , nice.🙂
@pretestpassed157
6 күн бұрын
Thankyou Brother.
Bhai rukna nahi chaiye tutorials kya mst explain Kiya tune 🔥🔥🔥👑👑
@pretestpassed157
4 күн бұрын
Thankyou ❤️
What a simple and subtle explanation!!🤌🙏.....Aapp jis tarah se aasan words use krte ho to explain is just too good!!
@pretestpassed157
6 күн бұрын
Thankyou ❤️
The final question explanation was fantastic
@pretestpassed157
6 күн бұрын
Thankyou
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
6 күн бұрын
Thankyou
Bhaiya please continue posting contest solution....Your explanation is very good....🙏
@pretestpassed157
6 күн бұрын
Sure. Whenever I will get time I will upload the editorial.
bahut badiya bhaiya '
@pretestpassed157
6 күн бұрын
Thankyou
good explanation
@pretestpassed157
6 күн бұрын
Thankyou
Nicely explained
@pretestpassed157
6 күн бұрын
Thankyou
Thanks, Brother 😇
int pre=0; // var to indicate number of changes happen to an element for(int i=0;i
what a brilliant explanation for 4th one
@pretestpassed157
6 күн бұрын
Thankyou
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
6 күн бұрын
Nice
@anshumaan1024
6 күн бұрын
nice, mene bhi same code kia hai
@closer9689
6 күн бұрын
@@anshumaan1024 Thanks! Good to know😇
bhaiya op
@pretestpassed157
6 күн бұрын
Thankyou
Best editorial . Please keep making such videos.
@pretestpassed157
6 күн бұрын
Sure, Thankyou
Thanks 🎉
@pretestpassed157
6 күн бұрын
Thankyou
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
6 күн бұрын
Nice approach.
Thanks bro.....awesome explainations!
@pretestpassed157
6 күн бұрын
Thankyou
Thanks for this editorial!!
@pretestpassed157
6 күн бұрын
Thankyou
Nice explanation from your end 😅
@pretestpassed157
6 күн бұрын
Thankyou
What an explanation 🔥🔥
@pretestpassed157
6 күн бұрын
Thankyou
You gained a new subscriber 😇
@pretestpassed157
6 күн бұрын
Thankyou
Bhaiya aap bahut accha samjhate ho , dp kaise strong karein ek bar vo bhi bata do
Thanks for sharing
@pretestpassed157
6 күн бұрын
Thanks
Please use dark mode 🙌
1 request bro :) PLEASE Don't join TLE ELIMINATORS you are best in explaning the problem :)
@pretestpassed157
6 күн бұрын
Thankyou ❤️
Hello, In the C question, why we ware not taking the case when it is not possible to convert all the elements into 1?
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
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.
In first question You didn't explain how the approach you told will give minimum number of flips always ?
@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.
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
5 күн бұрын
For the given index inversion required in requirement.
@TarunSantani
5 күн бұрын
@@pretestpassed157 so if there are 5 elements then case of requirements as (4,2),(3,3) doesnot exist ???
@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
5 күн бұрын
No because agr index 3 pr 3 inversion h to index 4 pr to usse equal ya bada hi hoga na
@TarunSantani
5 күн бұрын
thanks alot i think i got it
par bahiya -1 wla case to handle hi nahi kiya ?
@pretestpassed157
6 күн бұрын
Are you talking about the problem B?
Bhaiya try to speak much in English
@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