Flip

  Рет қаралды 14,664

Code with Alisha

Code with Alisha

Күн бұрын

Пікірлер: 33
@namanagrawal1908
@namanagrawal1908 Жыл бұрын
Great Explanation
@avinashvishwakarma6488
@avinashvishwakarma6488 2 жыл бұрын
The best part about your explanation is that you always develop the intuition first. That helps me a lot in solving other similar problems. Keep making more videos of interviewbit problems. Thanks a lot.
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thanks Avinash!
@manikmalhotra3903
@manikmalhotra3903 2 жыл бұрын
Just came across this channel. One of the best and easy-to-understand content. Thank you
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you Manik!
@rithikrk3695
@rithikrk3695 Жыл бұрын
Beauty with brain....very nice explanation mam!
@annanyamathur8869
@annanyamathur8869 2 жыл бұрын
I really like your way of explaining
@ankit_irl
@ankit_irl 2 жыл бұрын
Top notch explanation. Thank you for existing
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Glad you liked it!
@mrinalmadhav8119
@mrinalmadhav8119 3 жыл бұрын
Tysm mam, it was great, loved it, big fan of u mam
@attyuttamsaha8
@attyuttamsaha8 2 жыл бұрын
Really loved the way you have explained the concept and related the two problems.
@raju_bugude
@raju_bugude 2 жыл бұрын
nice explanation(intution part)
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much
@raj_kundalia
@raj_kundalia 2 жыл бұрын
Thanks for the video!
@akashnigam5321
@akashnigam5321 2 жыл бұрын
Just got to know that you are an alumni of my college IIT Bombay, your videos are really helpful.
@truptisatsangi6043
@truptisatsangi6043 2 жыл бұрын
very nice explaination along with related topic so you to go nowhere for 1 question. Great job
@mrinmoyhalder7293
@mrinmoyhalder7293 2 жыл бұрын
thanks for the approach, I understand the concept clearly, but one thing I want to say is that changing input may not be feasible always, so it's better to keep a variable which ++ and -- accordingly.
@rohankumarshah5679
@rohankumarshah5679 2 жыл бұрын
fantastic !!
@vikaskumar-kc4jv
@vikaskumar-kc4jv 2 жыл бұрын
Make more videos you are really awesome
@pharmacybyanuj2459
@pharmacybyanuj2459 2 жыл бұрын
your way of teaching is really superb when ever i understand any problem by you it clear my concepts. thanks Alisha didi di can you tell me how should i make dsa notes ? or make a video how to make dsa notes
@jatinbhatoya8420
@jatinbhatoya8420 2 жыл бұрын
for java users - public static int[] flip(String A) { int left = -1, right = -1; int sum = 0, maxSum = 0, currleft = 0; for (int i = 0; i < A.length(); i++) { sum += A.charAt(i) == '0' ? 1 : -1; if (sum < 0) { sum = 0; currleft = i + 1; } if (sum > maxSum) { maxSum = sum; left = currleft; right = i; } } if (left == -1 && right == -1) return new int[0]; return new int[]{left + 1, right + 1}; }
@rajbhardwaj2180
@rajbhardwaj2180 2 жыл бұрын
Hey Alisha Plz tell the way how to remember ,truth table of all flip flops quite confusing
@aniketkumarsinha2537
@aniketkumarsinha2537 3 жыл бұрын
I guess you skip this part "return the lexicographically smallest pair of L and R."
@avinashvishwakarma6488
@avinashvishwakarma6488 2 жыл бұрын
but code still runs. Why?
@dishantmeena1621
@dishantmeena1621 2 жыл бұрын
Actually in this approach, we are considering only the best flipping which will give us the maximum no. of ones. So, we are constantly updating our L and R values and only return the best pos. Hope this will help.
@siddharthjain4361
@siddharthjain4361 2 жыл бұрын
hi , answer could be one or more right ...how did u check lexicographically for the same
@deepakkapasia1
@deepakkapasia1 2 жыл бұрын
More than half test cases failed with this solution. Explaination good for the question and kadane algo but figuring out index not explained.
@Hadle695
@Hadle695 2 жыл бұрын
can u plzz share your code
@rizwanpolice2741
@rizwanpolice2741 2 жыл бұрын
At the timestamp 7:22 in the kadane algorighm. the solution will not work for all the negative integer array. For example if the array is {-2,-4,-9,-3,-1} The maximum subarray sum will be -1. But with the above pseudo code, it will be 0.
@sambhavsharma2780
@sambhavsharma2780 2 жыл бұрын
just init maxSum with arr[0]
@neerajjoshi1249
@neerajjoshi1249 2 жыл бұрын
for that take the value of max_sum as INT_MAX
@chandraprakashsahu8557
@chandraprakashsahu8557 2 жыл бұрын
can you please drop your linkedIn id
@govinth2462
@govinth2462 Жыл бұрын
hi mam I wanna Connect With you can i get your LinkedIn ID
Minimum Lights To Activate #InterviewBit || Intuition + Code + Example
19:16
Maximum Sum Triplet #InterviewBit Intuition+ Code + Example
17:36
Code with Alisha
Рет қаралды 19 М.
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
Operational Research - Decision Theory
45:08
BM Brotherhood
Рет қаралды 5
Kadane's Algorithm | Maximum Subarray Sum | Finding and Printing
20:09
take U forward
Рет қаралды 491 М.
Minimum Swaps to sort intuition + code C++ with explanation
15:25
Code with Alisha
Рет қаралды 23 М.
Counting Subarrays #InterviewBit || Intuition + Code+ Example
13:24
Code with Alisha
Рет қаралды 10 М.
The Midpoint Circle Algorithm Explained Step by Step
13:33
NoBS Code
Рет қаралды 143 М.
5 Simple Steps for Solving Dynamic Programming Problems
21:27
Reducible
Рет қаралды 1,1 МЛН
Ice Cream or Surprise Trip Around the World?
00:31
Hungry FAM
Рет қаралды 22 МЛН