Cody

Solution 2010975

Submitted on 9 Nov 2019 at 11:16 by kranthi kumar
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
DepTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],... [6;7;7;8;8;9;4;6;8;3;10;5;8;4;2],[22;27;39;43;46;17;41;40;10;8;30;58;21;36;14],0); ArrTime = datetime(2016,11,[1;1;1;1;1;1;2;2;2;2;3;3;3;3;3],... [9;10;10;13;11;12;7;9;11;6;13;8;11;7;5],[17;32;09;03;26;46;13;20;19;28;40;38;27;32;24],0); Destination = categorical([1;2;1;1;1;1;2;1;3;2;1;3;3;1;2],1:3,{'BOS';'NYC';'DC'}); tt = timetable(DepTime,Destination,ArrTime); y = 5; assert(isequal(myFun(tt),y))

x = 8×2 timetable <strong>DepTime</strong> <strong>Destination</strong> <strong>ArrTime</strong> <strong>____________________</strong> <strong>___________</strong> <strong>____________________</strong> <strong>01-Nov-2016 06:22:00</strong> BOS 01-Nov-2016 09:17:00 <strong>01-Nov-2016 07:39:00</strong> BOS 01-Nov-2016 10:09:00 <strong>01-Nov-2016 08:43:00</strong> BOS 01-Nov-2016 13:03:00 <strong>01-Nov-2016 08:46:00</strong> BOS 01-Nov-2016 11:26:00 <strong>01-Nov-2016 09:17:00</strong> BOS 01-Nov-2016 12:46:00 <strong>02-Nov-2016 06:40:00</strong> BOS 02-Nov-2016 09:20:00 <strong>03-Nov-2016 10:30:00</strong> BOS 03-Nov-2016 13:40:00 <strong>03-Nov-2016 04:36:00</strong> BOS 03-Nov-2016 07:32:00

2   Pass
DepTime = datetime(2016,11,[2;1;1;3],[4;10;7;1],[12;53;32;42],0); ArrTime = DepTime + hours(3); Destination = categorical({'DC';'BOS';'BOS';'BOS'}); tt = timetable(DepTime,Destination,ArrTime); y = 2; assert(isequal(myFun(tt),y))

x = 3×2 timetable <strong>DepTime</strong> <strong>Destination</strong> <strong>ArrTime</strong> <strong>____________________</strong> <strong>___________</strong> <strong>____________________</strong> <strong>01-Nov-2016 10:53:00</strong> BOS 01-Nov-2016 13:53:00 <strong>01-Nov-2016 07:32:00</strong> BOS 01-Nov-2016 10:32:00 <strong>03-Nov-2016 01:42:00</strong> BOS 03-Nov-2016 04:42:00