LeetCode 61 | Rotate List | Solution Explained (Java + Whiteboard)

Sdílet
Vložit
  • čas přidán 6. 07. 2020
  • Running Time: O(N)
    Space Complexity: O(1)
    FOLLOW ME:
    Github: github.com/xavierelon1
    Github HackerRank Solutions: github.com/XavierElon1/Hacker...
    Github Leetcode Solutions: github.com/XavierElon1/LeetCo...
    Facebook: / xavier.hollingsworth.3
    Instagram: / xavierelon
    LinkedIn: / xavier-hollingsworth-5...
    Twitter: / elon_xavier

Komentáře • 9

  • @lethihue795
    @lethihue795 Před 3 lety +1

    Yeyy!! I got 100% with your solution ^^. Thank u so much, Xavier Elon!

  • @HenggaoCai
    @HenggaoCai Před 3 lety +5

    I believe your internet speed affects the Leetcode runtime. I ran the same code and got 100%.

    • @xavierelon
      @xavierelon  Před 3 lety +2

      Ah that explains it

    • @wsrodeczku
      @wsrodeczku Před 3 lety +2

      @@xavierelon yep. I also have 100% with your solution :)

    • @xavierelon
      @xavierelon  Před 3 lety +2

      Małgosia Sobocińska yayyyy :)

  • @amandapanda3750
    @amandapanda3750 Před 2 lety

    Hey would you mind explaining why we need line 21? wouldn't this set the linked list back into a cycle if we set the tail's next node to the head?

  • @stevechade7471
    @stevechade7471 Před 2 lety

    genius solution 👌 assume 👏 ❤❤❤

  • @Atharva555
    @Atharva555 Před 3 lety +3

    great approach bruh! but what's with the hair

    • @xavierelon
      @xavierelon  Před 3 lety +3

      Lmao I was growing it out at the time