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

57.3% Correct | 42.7% Incorrect
Last solution submitted on Apr 21, 2019

Problem Comments