3026. Maximum Good Subarray Sum | Prefix Sums | Hash Table | Biweekly Contest 123

Поделиться
HTML-код
  • Опубликовано: 19 ноя 2024

Комментарии • 12

  • @rakshitkathawate8838
    @rakshitkathawate8838 9 месяцев назад +3

    Thanks for providing the intuition for the duplicate values. Appreciate your work

  • @ishan_19
    @ishan_19 9 месяцев назад +4

    Awesome Explanation Brother.... I was waiting for your video for this problem solution. This was my 2nd biweekly contest and I got stuck at this problem. It is a bit tough to digest for me but I really appreciate your time and efforts for complete in depth solution for these problems. Stay Blessed Bhaiya and thank you ..........

    • @ritishrai581
      @ritishrai581 9 месяцев назад

      Were you able to come up with the 2nd?

    • @ishan_19
      @ishan_19 9 месяцев назад

      @@ritishrai581 I couldn't submit it as I was getting stuck on one or two corner cases. That's why I was super Curious to know the solution

  • @alokgautam02
    @alokgautam02 9 месяцев назад

    THNX bro, well explained.

  • @mohdalizilani9896
    @mohdalizilani9896 9 месяцев назад +1

    i used vector of indices but still passed all test cases 🙃🙃

  • @kdramalove6308
    @kdramalove6308 9 месяцев назад

    ye minimize kya kr rahe hai samjh nahi aaya

    • @bishalkundu7592
      @bishalkundu7592 8 месяцев назад

      for a subarray [i ... j] the sum is prefSum[j] - prefSum[i - 1]. Now to maximise the sum of all subarrays we need to minimise the prefSum[i - 1] part as prefSum[j] will be fixed. That's why we are storing the minimised prefSum[i - 1] for each nums[i] in the map so that we dont need to traverse for all the duplicates.

  • @dhruvbandi6633
    @dhruvbandi6633 9 месяцев назад +2

    Jo part easy hai wo 10 baar samjata hai ye

    • @deepaksangwan-x7y
      @deepaksangwan-x7y 9 месяцев назад +3

      wahi uski toh repeat karega baar 😁😁😁😁 ,tough wale part ka direct code karta hai

  • @AmanjotSingh-rj7ox
    @AmanjotSingh-rj7ox Месяц назад

    bhai thoda dheere bol le