Cody

Problem 70. Alphabetize by last name

Solution 2979352

Submitted on 22 Sep 2020
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
list = {'Barney Google','Snuffy Smith','Dagwood Bumstead'}; alpha_list = {'Dagwood Bumstead','Barney Google','Snuffy Smith'} assert(isequal(alphabetize(list),alpha_list))

Error in solution: Line: 8 Column: 25 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

2   Fail
list = {'Harry Truman' 'Dwight Eisenhower' 'John F. Kennedy' 'Lyndon Johnson' 'Richard Nixon' 'Gerald Ford' 'Cleve Moler' 'Ronald Reagan' 'George Bush' 'Bill Clinton' 'George Bush' 'Barack Obama'}; alpha_list = {'George Bush' 'George Bush' 'Bill Clinton' 'Dwight Eisenhower' 'Gerald Ford' 'Lyndon Johnson' 'John F. Kennedy' 'Cleve Moler' 'Richard Nixon' 'Barack Obama' 'Ronald Reagan' 'Harry Truman'} assert(isequal(alphabetize(list),alpha_list))

Error in solution: Line: 8 Column: 25 Invalid expression. When calling a function or indexing a variable, use parentheses. Otherwise, check for mismatched delimiters.

Suggested Problems

More from this Author95

Community Treasure Hunt

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

Start Hunting!