Cody

Problem 45207. Calculate days until Christmas

Solution 2148623

Submitted on 3 Mar 2020 by Nikolaos Nikolaou
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
assert(isequal(daysUntilChristmas(2019,11,19),36))

d1 = 2019 11 19 0 0 0 d2 = 2019 12 25 0 0 0 num = 36

2   Pass
assert(isequal(daysUntilChristmas(2018,12,28),362))

d1 = 2018 12 28 0 0 0 d2 = 2019 12 25 0 0 0 num = 362

3   Pass
assert(isequal(daysUntilChristmas(2019,01,01),358))

d1 = 2019 1 1 0 0 0 d2 = 2019 12 25 0 0 0 num = 358

4   Pass
assert(isequal(daysUntilChristmas(2019,12,30),361))

d1 = 2019 12 30 0 0 0 d2 = 2019 12 25 0 0 0 num = -5 num = 361

Suggested Problems

More from this Author5

Community Treasure Hunt

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

Start Hunting!