Cody

# Problem 44466. The twelve days of Christmas

Solution 1394648

Submitted on 26 Dec 2017 by Atsushi Ueno
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   Pass
day = 0 - randi(50); accumulatedGifts = 0; assert( isequal(twelvetide(day), accumulatedGifts) )

4   Pass

5   Pass

6   Pass

7   Pass

8   Pass

9   Pass

10   Pass

11   Pass

12   Pass

13   Pass

14   Pass

15   Pass

16   Pass

17   Pass

18   Pass