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".
1600 Solvers
Number of 1s in the Binary Representation of a Number
357 Solvers
Make an awesome ramp for a tiny motorcycle stuntman
334 Solvers
Get the length of a given vector
3579 Solvers
The Answer to Life, the Universe, and Everything
383 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!