Problem 1321. Given a matrix, swap the 2nd & 3rd columns
Solution Stats
Problem Comments
-
7 Comments
Additional test cases have been added.
This is a poor question in that it tells you to swap the middle two columns of a 4x4 matrix, but then tests things other than than 4x4 matrices. You'll have to study the test cases and the given answers to see what the test maker is really after here :(
You may want to change the test description. You are not actually looking for the middle two columns. I won't give away the solution, but the columns you need to swap are hard-coded in. And using the two middle columns is ambiguous if the array is not an even length.
Can't understand test case 5. Can you improve this problem description?
This question should be corrected as the test cases are not 4*4 in all cases.
The problem is wrong.
The problem title and description have been improved.
Solution Comments
Show commentsProblem Recent Solvers1073
Suggested Problems
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1822 Solvers
-
716 Solvers
-
Number of 1s in a binary string
9094 Solvers
-
684 Solvers
-
Find last zero for each column
554 Solvers
More from this Author13
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!