Cody

# Problem 1388. Numbered lottery balls into cells

Solution 1734122

Submitted on 23 Feb 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
assert(isequal(lottery(4,2),7))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test1 (line 1) assert(isequal(lottery(4,2),7))

2   Fail
assert(isequal(lottery(6,3),90))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test2 (line 1) assert(isequal(lottery(6,3),90))

3   Fail
assert(isequal(lottery(8,6),266))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test3 (line 1) assert(isequal(lottery(8,6),266))

4   Fail
assert(isequal(lottery(10,4),34105))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test4 (line 1) assert(isequal(lottery(10,4),34105))

5   Fail
assert(isequal(lottery(lottery(5,2),lottery(4,2)),408741333))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test5 (line 1) assert(isequal(lottery(lottery(5,2),lottery(4,2)),408741333))

6   Fail
assert(isequal(lottery(18,7),197462483400))

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test6 (line 1) assert(isequal(lottery(18,7),197462483400))

7   Fail
x=[1 2047 86526 611501 1379400 1323652 627396 159027 22275 1705 66 1]; a=ceil(rand*12); assert(isequal(lottery(12,a),x(a)));

Undefined function or variable 's'. Error in lottery (line 12) ans+(sum(buckets)==n & all(diff(buckets)>=0))*s Error in Test7 (line 3) assert(isequal(lottery(12,a),x(a)));

8   Fail
filetext = fileread('lottery.m'); assert(isempty(strfind(filetext, 'switch'))) assert(isempty(strfind(filetext, 'case'))) assert(isempty(strfind(filetext, 'if')))

Assertion failed.