Cody

Problem 2432. Equation Times (of the day)

Solution 2782813

Submitted on 4 Aug 2020 by Mai Zhang
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
time = '4:22'; y_correct = [1 1100; 1 1; 1 1100; 1 1]; assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[4]} {[2]} {[2]} a = 4 b = 2 c = 2

2   Pass
time = '2:38'; y_correct = zeros(4,2); assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[2]} {[3]} {[8]} a = 2 b = 3 c = 8

3   Pass
time = '5:15'; y_correct = [0 0; 0 0; 1 1111; 1 1001]; assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[5]} {[1]} {[5]} a = 5 b = 1 c = 5

4   Pass
time = '1:23'; y_correct = [1 11; 1 1000; 0 0; 0 0]; assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[1]} {[2]} {[3]} a = 1 b = 2 c = 3

5   Pass
time = '1:02'; y_correct = zeros(4,2); assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[1]} {[0]} {[2]} a = 1 b = 0 c = 2

6   Pass
time = '1:11'; y_correct = [0 0; 0 0; 1 1111; 1 1111]; assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[1]} {[1]} {[1]} a = 1 b = 1 c = 1

7   Pass
time = '2:11'; y_correct = [1 1100; 1 1; 0 0; 0 0]; assert(isequal(equation_time(time),y_correct))

t = 1×3 cell array {[2]} {[1]} {[1]} a = 2 b = 1 c = 1