Increasing Triplet Subsequence | Leetcode

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ต.ค. 2024

ความคิดเห็น • 12

  • @AshiqMohammed
    @AshiqMohammed 3 หลายเดือนก่อน +4

    The algorithm is wrong at 13:24 for [5,3,0,3,1,-1,2]. It fails the condition where i < j < k.
    When you update variable named as first in code using if condition with -1(from nums[5] in list which is j) , the variable named second holds value 1 (from nums[4] in list which is i). Therefore fails the condition i

  • @ringringlord
    @ringringlord 5 หลายเดือนก่อน +2

    dry-run was exemplary. thank you

    • @techdose4u
      @techdose4u  5 หลายเดือนก่อน

      Welcome :)

  • @prashantbharti8314
    @prashantbharti8314 5 หลายเดือนก่อน

    We can just use a stack and maintain increasing sequence in it. You explanation also follows the same logic but is difficult to understand in comparison to stack. Let me know if my proposal is incorrect and miss any test cases

    • @techdose4u
      @techdose4u  5 หลายเดือนก่อน

      Yes you can solve using stack too :)

  • @joelsamuel9771
    @joelsamuel9771 3 หลายเดือนก่อน

    love the explanation!

  • @monikachauhan5931
    @monikachauhan5931 4 หลายเดือนก่อน

    Very good explanation 👏 keep it up

  • @MukulBhave-ig4yx
    @MukulBhave-ig4yx 5 หลายเดือนก่อน

    your explanations are super cool

    • @techdose4u
      @techdose4u  5 หลายเดือนก่อน

      Thanks :)

  • @abhilashpatel6852
    @abhilashpatel6852 5 หลายเดือนก่อน

    nice explanation. no others could have explained to me like this. thanks!

  • @abhivardhan395
    @abhivardhan395 2 หลายเดือนก่อน

    Best 👌