Problem 70. Alphabetize by last name
Solution Stats
Problem Comments
-
6 Comments
looks like there is problem with the 2nd test case result. The 'Cleve Molar' is shifted by 1 space in the ans
This problem can be trickier if the input can allow different styles of name representation, e.g., 'FirstName LastName' and 'LastName, FirstName'.
be careful with 'John F. Kennedy' case..
The change in output format was a pain !
This blew my mind. Finally got it.
Be careful with output format...
if length(alpha_list) > 5
alpha_list = alpha_list';
end
Solution Comments
-
1 Comment
Just don't get it. In the first test case, answer is 1xN and in the second Nx1, so I just put workaround. If anyone could explain to me why this matters...
-
1 Comment
Size 42. How it calculates the size?
-
2 Comments
-
2 Comments
What is wrong with test 2? It looks the same as my output.
I initially also found that strange. But later I found out the cell structure is different. N by 1 OR 1 by N problem.
-
1 Comment
You cheater
-
1 Comment
Task is done but Test suite is not dynamic
-
1 Comment
My crazy answer....
-
2 Comments
How?
???
-
2 Comments
Is there a bug in the Test Suite ? I made a code that resulted in the exact ideal answer but the Test has failed!?
I experienced the same thing...was able to generate the output exactly but received a failing score. Did you solve your issue?
-
3 Comments
http://www.kalzumeus.com/2010/06/17/falsehoods-programmers-believe-about-names/
Some alternative situations are presented in Problem 44538
( www.mathworks.com/matlabcentral/cody/problems/44538 ) and Problem 44541 ( https://www.mathworks.com/matlabcentral/cody/problems/44541 ).
Simillar solutions are really cool and concise.
Problem Recent Solvers1842
Suggested Problems
-
974 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
2512 Solvers
-
Cell Counting: How Many Draws?
1369 Solvers
-
659 Solvers
-
775 Solvers
More from this Author96
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!