I'd suggest adding test cases in which n (or abs(n)) is larger than the dimension of x; for example, x is a 4-by-4 matrix and n = 6.
How many trades represent all the profit?
520 Solvers
Rotate input square matrix 90 degrees CCW without rot90
380 Solvers
Relative ratio of "1" in binary number
394 Solvers
104 Solvers
2340 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!