Cody

Solution 1602865

Submitted on 7 Aug 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 'C:\foo\bar\baz\qux'; assert(isequal(shorten(x),'C:\..\qux'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

2   Fail
x = 'this\is\just\a\test'; assert(isequal(shorten(x),'this\..\test'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

3   Fail
x = 'testing\testing\123.mat'; assert(isequal(shorten(x),'testing\..\123.mat'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

4   Fail
x = 'testing\t1\t2\t3\t4\t5\t6\t7\t8\t9\t10\123.mat'; assert(isequal(shorten(x),'testing\..\123.mat'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

5   Fail
x = 'corp.company_name.com\dir1\dir2\dir3\dir4\file'; assert(isequal(shorten(x),'corp.company_name.com\..\file'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

6   Fail
x = 'dir1\dir2\dir3\d.txt'; assert(isequal(shorten(x),'dir1\..\d.txt'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.

7   Fail
x = 'dir1\dir#2\dir_3\dir%4\dir(5)\dir+6\d.txt'; assert(isequal(shorten(x),'dir1\..\d.txt'))

Error in solution Line: 5 Column: 19 Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.