Cody

Problem 1713. Can you beat the lottery?

Solution 1917370

Submitted on 31 Aug 2019
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
check = 1; while check == 1 D1 = round(rand(1,1)*4+1); D2 = round(rand(1,1)*4+1); D3 = round(rand(1,1)*4+1); draw = sort([D1 D2 D3]); if size(unique(draw), 2) == 3 check = 0; end end assert(isequal(sort(lottery()),draw))

Undefined function or variable 'x'. Error in lottery (line 2) draw = [x x x]; Error in Test1 (line 11) assert(isequal(sort(lottery()),draw))

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!