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

41.6% Correct | 58.4% Incorrect
Last Solution submitted on Sep 24, 2019

Problem Comments