This one should work for all of the test cases except that you have some numerical precision issues with the last test case. Please replace it with a numerical comparison that takes into account precision (my code is returning numbers with no decimal point but the test code returns something less pretty).
4339 Solvers
Back to basics 2 - Function Path
163 Solvers
Vectorize the digits of an Integer
269 Solvers
Arrange vector in ascending order
624 Solvers
Penny flipping - calculate winning probability (easy)
144 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!