Cody

Problem 43131. Which coins to give

Solution 3310328

Submitted on 21 Oct 2020
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
x = 0.63; y_correct = [1 0 1 0 1 1]; assert(isequal(coins(x),y_correct))

point_five = 1 point_two = 0 point_one = 1 point__five = 0 point__two = 1 point__one = 0

Assertion failed.

2   Fail
x = 0.49; y_correct = [0 2 0 1 2 0]; assert(isequal(coins(x),y_correct))

point_five = 0 point_two = 2 point_one = 0 point__five = 1 point__two = 1 point__one = 1

Assertion failed.

Suggested Problems

More from this Author12

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!