Move Pieces to Obtain a String | Leetcode 2337

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

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

  • @namanvijay3514
    @namanvijay3514 9 дней назад +3

    The movable distance (prev_idx) is not needed, just remove it from the code, it still works. Thanks

  • @IshwaryaP-zo5jk
    @IshwaryaP-zo5jk 9 дней назад

    sir you deserve millions of likes and subscribe for your hardward. Hats off !

  • @PriyaSharma-v8u
    @PriyaSharma-v8u 9 дней назад

    bestest explanation for such a question!

  • @vijethkashyap151
    @vijethkashyap151 9 дней назад

    Best explanation, thanks!

  • @madhavdua8588
    @madhavdua8588 9 дней назад +2

    Very helpful

  • @monikarawat5125
    @monikarawat5125 9 дней назад +1

    Thank you 🙏🏻 well understood 🎉

  • @sailendrachettri8521
    @sailendrachettri8521 9 дней назад +1

    Thank you sir :)

  • @androidterminal3924
    @androidterminal3924 10 дней назад +3

    thank you!

  • @nikoloztskhvedadze4167
    @nikoloztskhvedadze4167 9 дней назад

    well explained

  • @kanaklata3421
    @kanaklata3421 9 дней назад +4

    how can you say that we need to do below 10^8 like i don't know how anyone can tell just from seeing constraints if n*n will be passed or not ?

    • @tarunpahuja3443
      @tarunpahuja3443 9 дней назад

      If N=10^8 takes 1 second , please tell what it takes for n^2 and if it's feasible.

    • @techdose4u
      @techdose4u  8 дней назад

      It all can be said before even starting to think about an algo :)
      That's how good programmers always get AC in one attempt.

    • @kanaklata3421
      @kanaklata3421 8 дней назад

      @@techdose4u oh ok i was just curious that how do you know it takes 1 sec for 10^8 ops but i read an article and got it , thx

    • @techdose4u
      @techdose4u  8 дней назад

      @kanaklata3421 yep its a set standard to make every submission fair and independent of machine power.

  • @21flame72
    @21flame72 9 дней назад

    Thankyou sir

  • @pk2468-z2w
    @pk2468-z2w 9 дней назад

    I had to add the following code after line 17 of your code to ensure that one of the pointers doesn't become out of bounds. I was using Python.
    if first == n or second == n:
    return False

  • @sarthakbhatia7639
    @sarthakbhatia7639 8 дней назад

    Man you are amazing :)

  • @ankitmittal6284
    @ankitmittal6284 8 дней назад

    I didn't understand the use of limit_idx. I tried this qestion in leetcode without using limit_idx and was able to solve all the testcase without it. Is I am missing something?

    • @techdose4u
      @techdose4u  8 дней назад

      even if you don’t use it will work.
      but that is to explain the allowed movements

  • @IshwaryaP-zo5jk
    @IshwaryaP-zo5jk 9 дней назад

    sir you deserve millions of likes and subscribe for your hardward. Hats off !