Flip

Поділитися
Вставка
  • Опубліковано 10 лют 2025

КОМЕНТАРІ • 33

  • @avinashvishwakarma6488
    @avinashvishwakarma6488 2 роки тому +12

    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.

  • @manikmalhotra3903
    @manikmalhotra3903 2 роки тому +5

    Just came across this channel. One of the best and easy-to-understand content. Thank you

  • @attyuttamsaha8
    @attyuttamsaha8 3 роки тому +3

    Really loved the way you have explained the concept and related the two problems.

  • @ankit_irl
    @ankit_irl 2 роки тому +2

    Top notch explanation. Thank you for existing

  • @annanyamathur8869
    @annanyamathur8869 2 роки тому +1

    I really like your way of explaining

  • @mrinmoyhalder7293
    @mrinmoyhalder7293 2 роки тому +1

    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.

  • @mrinalmadhav8119
    @mrinalmadhav8119 3 роки тому +1

    Tysm mam, it was great, loved it, big fan of u mam

  • @akashnigam5321
    @akashnigam5321 2 роки тому

    Just got to know that you are an alumni of my college IIT Bombay, your videos are really helpful.

  • @namanagrawal1908
    @namanagrawal1908 Рік тому

    Great Explanation

  • @truptisatsangi6043
    @truptisatsangi6043 2 роки тому

    very nice explaination along with related topic so you to go nowhere for 1 question.
    Great job

  • @raju_bugude
    @raju_bugude 3 роки тому +2

    nice explanation(intution part)

  • @vikaskumar-kc4jv
    @vikaskumar-kc4jv 2 роки тому +1

    Make more videos you are really awesome

  • @pharmacybyanuj2459
    @pharmacybyanuj2459 2 роки тому +1

    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

  • @rohankumarshah5679
    @rohankumarshah5679 3 роки тому +1

    fantastic !!

  • @raj_kundalia
    @raj_kundalia 2 роки тому

    Thanks for the video!

  • @rithikrk3695
    @rithikrk3695 Рік тому

    Beauty with brain....very nice explanation mam!

  • @jatinbhatoya8420
    @jatinbhatoya8420 2 роки тому +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 роки тому +1

    Hey Alisha Plz tell the way how to remember ,truth table of all flip flops quite confusing

  • @aniketkumarsinha2537
    @aniketkumarsinha2537 3 роки тому +6

    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.

  • @rizwanpolice2741
    @rizwanpolice2741 2 роки тому +1

    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.

  • @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 роки тому +1

    can u plzz share your code

  • @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