The problem says the input is a positive integer but the first test inputs 0. In my code that caused r = 0/0 error. Please change the wording to "input is non-negative".
Make the vector [1 2 3 4 5 6 7 8 9 10]
36269 Solvers
1610 Solvers
Arrange Vector in descending order
4262 Solvers
Matrix indexing with two vectors of indices
491 Solvers
2733 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!