Cody

Problem 2625. Shorten pathname

Created by Matthew Eicholtz in Community

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.78% Correct | 42.22% Incorrect
Last solution submitted on Apr 21, 2019

Problem Comments