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

58.24% Correct | 41.76% Incorrect
Last solution submitted on Apr 21, 2019

Problem Comments