Cody

Solution 1974305

Submitted on 13 Oct 2019 by Nikolaos Nikolaou
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   Pass
x = 0.63; y_correct = [1 0 1 0 1 1]; assert(isequal(coins(x),y_correct))

y = 1 x = 0.1300 y = 1 0 x = 0.1300 y = 1 0 1 x = 0.0300 y = 1 0 1 0 x = 0.0300 y = 1 0 1 0 1 x = 0.0100 y = 1 0 1 0 1 0 x = 0.0100 y = 1 0 1 0 1 1

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

y = 0 x = 0.4900 y = 0 2 x = 0.0900 y = 0 2 0 x = 0.0900 y = 0 2 0 1 x = 0.0400 y = 0 2 0 1 1 x = 0.0200 y = 0 2 0 1 1 1 x = 0.0100 y = 0 2 0 1 1 2 y = 0 2 0 1 1 0 y = 0 2 0 1 2 0