LeetCode Valid Palindrome II Solution Explained - Java

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

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

  • @nupurjaiswal957
    @nupurjaiswal957 4 ปีที่แล้ว +7

    Love your explanation. It would be helpful if you discuss the time complexity of the solution in future videos. Thanks!

    • @pushpakbhagat6792
      @pushpakbhagat6792 3 ปีที่แล้ว

      Hey are u preparing for coding interview or something lets be coding friends?,

  • @carriezhang1999
    @carriezhang1999 4 ปีที่แล้ว +1

    like the easy going /casual atmosphere
    your video conveys👍

  • @sundaramsaroj2087
    @sundaramsaroj2087 2 ปีที่แล้ว

    I really liked the approach and the way he said:"We are really having a bad day guys" when the submission failed..

  • @amitbhattacharya356
    @amitbhattacharya356 2 ปีที่แล้ว +1

    What will be the time complexity for this solution?

  • @henggaocai8276
    @henggaocai8276 4 ปีที่แล้ว

    You explain the code very well.

  • @cutiex7357
    @cutiex7357 3 ปีที่แล้ว +2

    This is so bad I love it!

  • @jennyzhenwang8242
    @jennyzhenwang8242 3 ปีที่แล้ว +1

    Thank you for sharing! Amazing! Could anybody help explain why I can't do this ----return helperMethod (s, ++a_pointer, b_pointer) || helperMethod (s, a_pointer, --b_pointer). It's wrong when I do this.

    • @legendry
      @legendry 2 ปีที่แล้ว

      Actually, you're using the increment(++) & decrement(- -) operator with the respective pointers which is leading to an unwanted update of the value of the pointers which in turn is leading to disruption in the normal flow of the loop(the expected one) and ultimately a wrong solution and so instead use '+' operator or '-' in this case.

  • @karthikps9544
    @karthikps9544 5 ปีที่แล้ว +1

    Can you explain it again please in a new video??

  • @ramyakrishnavairagyam4270
    @ramyakrishnavairagyam4270 5 ปีที่แล้ว +1

    is the time complexity n^2?

    • @rodrickedwards2759
      @rodrickedwards2759 4 ปีที่แล้ว +1

      Still O(n)

    • @coolsebz
      @coolsebz 4 ปีที่แล้ว +2

      @@rodrickedwards2759 yeah, you're right, it got me too, but you only enter the second while loop once you found a mismatch so it makes sense

  • @leomonz
    @leomonz 4 ปีที่แล้ว +1

    Nick must be tired to fail three times in the row

  • @RodrigoVillarreal
    @RodrigoVillarreal 5 ปีที่แล้ว +1

    I didn't know HackerRank changed the interface

  • @lifeofme3172
    @lifeofme3172 ปีที่แล้ว

    excellent

  • @pushpakbhagat6792
    @pushpakbhagat6792 3 ปีที่แล้ว

    Its ok dude nice video✌️

  • @amrholo4445
    @amrholo4445 2 ปีที่แล้ว

    Thanks alot

  • @frankf5398
    @frankf5398 2 ปีที่แล้ว

    damn eziest solution I saw