One of the good way to solve the last problem would have been Take two vector v1 and v2 If input is less than zero push back in v1 If input is greater than equal to zero push back in v2 Now find sum of v1 and multiply with -2 and add it to sum of v2 that would be the ans 😅
For Last Problem (Updating A) What if array has single negative element which is minimum than all min subarray for ex. [1, 1, -200, 3, 4, -1, -2], but alice cannot make it positive because he cannot choose subaary of length 1, it is given (L
00:03 Discussion of quick solutions for Codechef Starters 130 problems. 02:14 Convert binary string to alternating string with bit flipping 06:36 Transforming array values to make them equal 08:49 Make all array elements equal using specific conditions. 13:16 Determine if a string can be flipped to have an even number of alternating characters 15:31 Understanding the partition of the string based on conditions 19:55 Optimizing sum by changing substrings 22:18 Strategic gameplay between alice and Bob 26:56 Explanation of calculating minimum sum for substring
How updating A question works?? In the question it is given that the size of subarray should be atleast 2. And it is possible that kadane's algorithm find single -ve no. Which is minimum. Eg. 1 4 -10 5 15 -2 -3 -2 2 . Here the least no. Should be -10 but we cant remove -10 as the size of subarray is 1 . Please explain
Got it. But how do you approach this method ? Is this some classical problem(for atleast length 2) or we can find minimum sum subarray with atleast k elements? Pls explain
as we have to make all the element equal and we cannot change the border element (i.e. the first and last). So, it should be equal initially, otherwise we will not be able to make all the element equal in the given array.
Because see we can't change the border elements as written in the question condition itself so the conditions to fulfilled only if the border elements are equal otherwise no matter what you do the array can't be equalised. Hope this helps .
DM me on Instagram for CP Expert Sheet 🚀
amazing explanation brother now i just see your videos and i understand all the things very well
Glad to hear that
One of the good way to solve the last problem would have been
Take two vector v1 and v2
If input is less than zero push back in v1
If input is greater than equal to zero push back in v2
Now find sum of v1 and multiply with -2 and add it to sum of v2 that would be the ans 😅
Bro, it's wrong, you can try, we don't want subsequence, we want substring
@@AbhinavAwasthi yes sir.
🥲
For Last Problem (Updating A)
What if array has single negative element which is minimum than all min subarray for ex. [1, 1, -200, 3, 4, -1, -2], but alice cannot make it positive because he cannot choose subaary of length 1, it is given (L
same doubt
He can actually choose, read the problem
How to build this kind of intuition like in the last question?
Great explanation btw ❤❤
It's all about practice, thanks!
Awesome explanation ❤
Glad you liked it
00:03 Discussion of quick solutions for Codechef Starters 130 problems.
02:14 Convert binary string to alternating string with bit flipping
06:36 Transforming array values to make them equal
08:49 Make all array elements equal using specific conditions.
13:16 Determine if a string can be flipped to have an even number of alternating characters
15:31 Understanding the partition of the string based on conditions
19:55 Optimizing sum by changing substrings
22:18 Strategic gameplay between alice and Bob
26:56 Explanation of calculating minimum sum for substring
Thanks 🙏🏻
Make binary strings is good one, I’m a newbie in CP then how to solve such questions going ahead?
Practice is the key, practice problems regularly and participate in contests
How updating A question works??
In the question it is given that the size of subarray should be atleast 2. And it is possible that kadane's algorithm find single -ve no. Which is minimum. Eg. 1 4 -10 5 15 -2 -3
-2 2 . Here the least no. Should be -10 but we cant remove -10 as the size of subarray is 1 .
Please explain
What is shown in the code isn't directly kadane's algo. If you will check it, it considers at least two elements for min value
Got it. But how do you approach this method ?
Is this some classical problem(for atleast length 2) or we can find minimum sum subarray with atleast k elements? Pls explain
@@AbhayNegi-qs1fc bro why we have taken the previous element 0 in 5 th question
I think multiple people already explained
Ronak, because next two non equal numbers, there will be atleast 1 number which is one
Need explanation for Costly Swapping
Will try to upload
Helpful sir
Glad to hear that
Thanks bhaiya ❤
Welcome
sir without dsa till which rating questions we can do in both codechef and codeforces
Bro, learn DSA side by side
why border elemt will be equal a must condition in ques no 3
as we have to make all the element equal and we cannot change the border element (i.e. the first and last). So, it should be equal initially, otherwise we will not be able to make all the element equal in the given array.
Because see we can't change the border elements as written in the question condition itself so the conditions to fulfilled only if the border elements are equal otherwise no matter what you do the array can't be equalised. Hope this helps .
I think many people already explained
COSS ka answer bhi explain kardo yaar
Will try to upload
Helpful
Thanks