Cody

Problem 2625. Shorten pathname

Given a pathname string, return a condensed version by replacing intermediate folders with '..'.

Example

If

fullpath = 'C:\foo\bar\baz\qux';

then

shortpath = 'C:\..\qux';

Solution Stats

42.06% Correct | 57.94% Incorrect
Last Solution submitted on Jan 26, 2020

Problem Comments


Problem Recent Solvers42

Problem Tags