Cody

# Problem 44466. The twelve days of Christmas

Solution 1404251

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) )

a = 0

3   Pass

a = 0

4   Pass

a = 1

5   Pass

a = 4

6   Pass

a = 10

7   Pass

a = 20

8   Pass

a = 35

9   Pass

a = 56

10   Pass

a = 84

11   Pass

a = 120

12   Pass

a = 165

13   Pass

a = 220

14   Pass

a = 286

15   Pass

a = 364

16   Pass

a = 364

17   Pass

a = 364

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

a = 364 a = 364 a = 364 a = 364 a = 364 a = 364 a = 364 a = 364 a = 364 a = 364

### Community Treasure Hunt

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

Start Hunting!