LeetCode 1712. Ways to Split Array Into Three Subarrays

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

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

  • @artistic__08
    @artistic__08 Год назад +1

    Amazing explaination!!
    But this is a O(nlogn) solution, is a O(n) solution possible ?

  • @8thFloorHarmony
    @8thFloorHarmony 2 года назад +1

    fatser than 100.0% looks so amazing :p

  • @jaatharsh
    @jaatharsh 3 года назад

    clear explanation, thanks dude

  • @sandeepnallala48
    @sandeepnallala48 3 года назад

    Sir why it is r-l+1 will be the no.of ways for that particular i iteration.. please explain

    • @happycoding1093
      @happycoding1093  3 года назад

      l and r are the two boundaries that we can split between 2nd and 3rd, which means any split between l and r are a valid split, so in total, r-l+1

    • @sandeepnallala48
      @sandeepnallala48 3 года назад

      @@happycoding1093 Thanks sir 💯❤️

  • @palukurisainikhil1228
    @palukurisainikhil1228 3 года назад

    Sir done using backtracking but TLE,can we do it in top down sir

    • @happycoding1093
      @happycoding1093  3 года назад

      given the constraints 10^5, I would say no backtracking

    • @anishsuman1371
      @anishsuman1371 3 года назад

      N 2 solution is bruteforce