Flip

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

Code with Alisha

Code with Alisha

Күн бұрын

Пікірлер: 33
@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!
@attyuttamsaha8
@attyuttamsaha8 2 жыл бұрын
Really loved the way you have explained the concept and related the two problems.
@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.
@annanyamathur8869
@annanyamathur8869 2 жыл бұрын
I really like your way of explaining
@akashnigam5321
@akashnigam5321 2 жыл бұрын
Just got to know that you are an alumni of my college IIT Bombay, your videos are really helpful.
@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
@raju_bugude
@raju_bugude 2 жыл бұрын
nice explanation(intution part)
@probabilitycodingisfunis1
@probabilitycodingisfunis1 2 жыл бұрын
Thank you so much
@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
@rithikrk3695
@rithikrk3695 Жыл бұрын
Beauty with brain....very nice explanation mam!
@namanagrawal1908
@namanagrawal1908 Жыл бұрын
Great Explanation
@truptisatsangi6043
@truptisatsangi6043 2 жыл бұрын
very nice explaination along with related topic so you to go nowhere for 1 question. Great job
@vikaskumar-kc4jv
@vikaskumar-kc4jv 2 жыл бұрын
Make more videos you are really awesome
@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
@raj_kundalia
@raj_kundalia 2 жыл бұрын
Thanks for the video!
@rohankumarshah5679
@rohankumarshah5679 2 жыл бұрын
fantastic !!
@aniketkumarsinha2537
@aniketkumarsinha2537 2 жыл бұрын
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.
@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.
@siddharthjain4361
@siddharthjain4361 2 жыл бұрын
hi , answer could be one or more right ...how did u check lexicographically for the same
@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 М.
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 12 МЛН
Из какого города смотришь? 😃
00:34
МЯТНАЯ ФАНТА
Рет қаралды 2,5 МЛН
ТЫ В ДЕТСТВЕ КОГДА ВЫПАЛ ЗУБ😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 4,5 МЛН
Minimum Swaps to sort intuition + code C++ with explanation
15:25
Code with Alisha
Рет қаралды 23 М.
Maximum Ones after Modification InterviewBit Code + Examples C++
17:53
Code with Alisha
Рет қаралды 11 М.
Kadane's Algorithm | Maximum Subarray Sum | Finding and Printing
20:09
take U forward
Рет қаралды 487 М.
Making an Algorithm Faster
30:08
NeetCodeIO
Рет қаралды 148 М.
Sliding Window Maximum || Maximum of all subarrays of size k
16:16
Code with Alisha
Рет қаралды 18 М.
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 12 МЛН