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.97% Correct | 57.03% Incorrect
Last Solution submitted on Mar 21, 2020

Problem Comments