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

46.99% Correct | 53.01% Incorrect
Last Solution submitted on Feb 22, 2024

Problem Comments

Solution Comments

Show comments


Problem Recent Solvers66

Problem Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!