Cody

# Problem 44466. The twelve days of Christmas

Solution 2160841

Submitted on 15 Mar 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   Pass
% The Test Suite will be updated if inappropriate submissions are received. % This includes hard-coded (pre-calculated, externally calculated, manually calculated) 'solutions'. % EDIT (2019-06-24). Anti-hacking provision % Ensure builtin function will be called. (Probably only the second of these will work.) ! del fileread.m ! rm -v fileread.m % Probably only the second of these will work. RE = regexp(fileread('twelvetide.m'), '\w+', 'match'); %tabooWords = {'ans', 'assert', 'freepass', 'tic'}; tabooWords = {'assert', 'freepass'}; testResult = cellfun( @(z) ismember(z, tabooWords), RE ); msg = ['Please do not do that in your code!' char([10 13]) ... 'Found: ' strjoin(RE(testResult)) '.' char([10 13]) ... 'Banned word.' char([10 13])]; assert(~any( cellfun( @(z) ismember(z, tabooWords), RE ) ), msg) % END EDIT (2019-06-24)

2   Pass

3   Fail
day = 0 - randi(50); accumulatedGifts = 0; assert( isequal(twelvetide(day), accumulatedGifts) )

Assertion failed.

4   Fail

Assertion failed.

5   Fail

Assertion failed.

6   Fail

Assertion failed.

7   Fail

Assertion failed.

8   Fail

Assertion failed.

9   Fail

Assertion failed.

10   Fail

Assertion failed.

11   Fail

Assertion failed.

12   Fail

Assertion failed.

13   Fail

Assertion failed.

14   Fail

Assertion failed.

15   Fail

Assertion failed.

16   Fail

Assertion failed.

17   Fail

Assertion failed.

18   Fail