Cody

# Problem 2483. How long until the weekend?

Solution 482894

Submitted on 5 Aug 2014
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
%% % It's going to be a long week a = [2014 8 4 08 00 0]; weekend(a) b = 105; assert(abs(weekend(a)-b)<1e-5)

ans = 105 ans = 105 ans = 105

3   Pass
%% a = [2014 08 05 10 23 34]; weekend(a) b=78.607222; assert(abs(weekend(a)-b)<1e-5)

ans = 78.6072 ans = 78.6072 ans = 78.6072

4   Pass
%% % Half way there a = [2014 08 06 13 39 15]; b = 51.3458333; assert(abs(weekend(a)-b)<1e-5)

ans = 51.3458

5   Pass
%% a = [2014 08 07 23 12 41]; b = 17.788611; assert(abs(weekend(a)-b)<1e-5)

ans = 17.7886

6   Pass
%% % Counting down the minutes a = [2014 08 08 16 31 59]; b = 0.466944; assert(abs(weekend(a)-b)<1e-5)

ans = 0.4669

7   Fail
%% a = [2013 08 29 15 59 10]; b = 25.013888; assert(abs(weekend(a)-b)<1e-5)

Error: Assertion failed.

8   Fail
%% a = [2013 12 30 09 05 9]; b = 103.914166; assert(abs(weekend(a)-b)<1e-5)

Error: Assertion failed.

9   Fail
%% a = [2012 02 27 10 32 33]; b = 102.457500; assert(abs(weekend(a)-b)<1e-5)

Error: Assertion failed.

10   Pass
%% % Prohibited functions. List may be added to if more cheats arise t=evalc('type weekend.m'); badwords={'str2num'}; assert(~any(cellfun(@(y) any(strfind(t,y)),badwords)));