Cody

# Problem 44466. The twelve days of Christmas

Solution 1404312

Submitted on 4 Jan 2018 by A. Sawas
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

2   Pass
day = 0 - randi(50); accumulatedGifts = 0; assert( isequal(twelvetide(day), accumulatedGifts) )

ans = 0

3   Pass

ans = 0

4   Pass

ans = 1

5   Pass

ans = 4

6   Pass

ans = 10

7   Pass

ans = 20

8   Pass

ans = 35

9   Pass

ans = 56

10   Pass

ans = 84

11   Pass

ans = 120

12   Pass

ans = 165

13   Pass

ans = 220

14   Pass

ans = 286

15   Pass

ans = 364

16   Pass

ans = 364

17   Pass

ans = 364

18   Pass
for i = 1 : 10 day = 12 + randi(300); accumulatedGifts = 364; assert( isequal(twelvetide(day), accumulatedGifts) ) end;

ans = 364 ans = 364 ans = 364 ans = 364 ans = 364 ans = 364 ans = 364 ans = 364 ans = 364 ans = 364

### Community Treasure Hunt

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

Start Hunting!