Cody

Solution 2141263

Submitted on 26 Feb 2020 by Asif Newaz
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
d_in = '22-Oct-2014'; m_correct = 6; m_test = monthsUntilMatch(d_in); assert(isequal(m_test,m_correct))

a = datetime 22-Oct-2014 b = 2014 10 22 0 0 0 match = 4 c = 7 c = 2 c = 5 c = 1 c = 1 c = 4

2   Pass
d_in = '2-Jul-2014'; m_correct = 14; m_test = monthsUntilMatch(d_in); assert(isequal(m_test,m_correct))

a = datetime 02-Jul-2014 b = 2014 7 2 0 0 0 match = 4 c = 7 c = 3 c = 5 c = 1 c = 3 c = 6 c = 2 c = 2 c = 5 c = 7 c = 3 c = 5 c = 1 c = 4

3   Pass
d_in = '12-May-2011'; m_correct = 8; m_test = monthsUntilMatch(d_in); assert(isequal(m_test,m_correct))

a = datetime 12-May-2011 b = 2011 5 12 0 0 0 match = 5 c = 1 c = 3 c = 6 c = 2 c = 4 c = 7 c = 2 c = 5

4   Pass
d_in = '14-Jul-1789'; m_correct = 14; m_test = monthsUntilMatch(d_in) assert(isequal(m_test,m_correct))

a = datetime 14-Jul-1789 b = 1789 7 14 0 0 0 match = 3 c = 6 c = 2 c = 4 c = 7 c = 2 c = 5 c = 1 c = 1 c = 4 c = 6 c = 2 c = 4 c = 7 c = 3 m_test = 14

5   Pass
d_in = '31-Dec-1999'; m_correct = 3; m_test = monthsUntilMatch(d_in) assert(isequal(m_test,m_correct))

a = datetime 31-Dec-1999 b = 1999 12 31 0 0 0 match = 6 c = 2 c = 5 c = 6 m_test = 3