LeetCode 71 | Simplify Path | Solution Explained (Java + Whiteboard)

Sdílet
Vložit
  • čas přidán 7. 09. 2024
  • The description reads:
    "Given an absolute path for a file (Unix-style), simplify it. Or in other words, convert it to the canonical path.
    In a UNIX-style file system, a period . refers to the current directory. Furthermore, a double period .. moves the directory up a level.
    Note that the returned canonical path must always begin with a slash /, and there must be only a single slash / between two directory names. The last directory name (if it exists) must not end with a trailing /. Also, the canonical path must be the shortest string representing the absolute path."
    Running Time: O(n)
    Space Complexity: O(n)
    Github: github.com/xav...
    Github HackerRank Solutions: github.com/Xav...
    Github Leetcode Solutions: github.com/Xav...
    Facebook: / xavier.hollingsworth.3
    Instagram: / xavierelon
    LinkedIn: / xavier-hollingsworth-5...
    Twitter: / elon_xavier

Komentáře • 3

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

    nice explanation bro,can u explain it little more bcz some are new to problem solving and some are not familar with methods.And try to speak slowly bcz we are not americans to understand ur english at ur pace.Thanks for explanation

    • @xavierelon
      @xavierelon  Před 3 lety

      Thanks for the criticism. I will try to slow down and explain better

  • @ladro_magro5737
    @ladro_magro5737 Před 4 měsíci +1

    I don't think this is a nice explanation. Realistically, you didn't even know how to solve a problem without looking at the cheat sheet, which means you don't actually fully understand the solution. And since you do not understand the solution it is impossible to explain it properly. My recommendation is to study the solution deeply before creating any future videos.