Cody

Problem 42457. Get the array of sum for three consecutive numbers in an array

Solution 703685

Submitted on 20 Jul 2015 by Alex Gansmann
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
%% x = [15,17]; y_correct = 0; assert(isequal(GetSumOf3Numbers(x),y_correct)) x = [1]; y_correct = 0; assert(isequal(GetSumOf3Numbers(x),y_correct)) x = [1,2,3]; y_correct = 6; assert(isequal(GetSumOf3Numbers(x),y_correct)) x = [4,9,2,6,1,7]; y_correct = [15,17,9,14]; assert(isequal(GetSumOf3Numbers(x),y_correct))

y = 0 y = 0 y = 6 y = 15 y = 15 17 y = 15 17 9 y = 15 17 9 14

Suggested Problems

More from this Author1