Your Submissions
You haven't submitted any code for this challenge yet. Solve the problem by passing all the test cases, and your submissions will appear here.
xxxxxxxxxx
36
var assert = require('assert');
function simplifyAbsolutePath(path) {
// fill in the solution
return;
}
try {
assert.equal(simplifyAbsolutePath('/home/'), '/home');
console.log('PASSED: ' + "`simplifyAbsolutePath('/home/') should return `/home`");
} catch (err) {
console.log(err);
}
try {
assert.equal(simplifyAbsolutePath('/foo/../bar/x'), '/bar/x');
console.log('PASSED: ' + "`simplifyAbsolutePath('/foo/../bar/x')` should return `/bar/x`");
} catch (err) {
console.log(err);
}
try {
assert.equal(simplifyAbsolutePath('/a/./b/../../c/'), '/c');
console.log('PASSED: ' + "`simplifyAbsolutePath('/a/./b/../../c/')` should return `/c``");
} catch (err) {
console.log(err);
OUTPUT
Results will appear here.