Problem 19. Swap the first and last columns
Solution Stats
Problem Comments
-
18 Comments
need to fix the test suite
Updated the test so that fliplr will fail. Rescoring. Thanks for all the comments.
Check your test case. Test case with single dimension array is wrong
it can be done in many ways
Swapping the first and last columns means the input argument must have columns more than 1.
Thus, the solution, B=1 for A=1, cannot be accepted unless it is clearly written in the problem.
Test 3 B_correct is wrong: where, test B_correct=[3 5 0 2 1] it should be B_correct=[3 2 0 5 1]
nice one!
nice one!
test 3 is right only 2 columns changed
nice
Why am I getting wrong answer for this [A(:,end),(:,2:end-1),(:,1)]
nice
very nicee
nice
good problem
Good problem.
very nice
Good one
Solution Comments
Show commentsProblem Recent Solvers20445
Suggested Problems
-
Increment a number, given its digits
650 Solvers
-
Project Euler: Problem 1, Multiples of 3 and 5
3169 Solvers
-
516 Solvers
-
Rotate input square matrix 90 degrees CCW without rot90
613 Solvers
-
5519 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!