71. Simplify Path
# Medium
Solution:
find the effective start
'/'
find the effective end
'/'
, extract string between start and endif string =
'.'
, do nothing; if string ='..'
,path2.pop()
; elsepath2.append(string)
convert
path2
list to a real path string
Time complexity = , space complexity =
Last updated
Was this helpful?