Cody

Solution 1983748

Submitted on 20 Oct 2019 at 18:22 by Nikolaos Nikolaou
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 = [1 2 3 4 5]; y = [6 7 8]; [x, num]=unshift(x, y); y_correct = [6 7 8 1 2 3 4 5]; num_correct=8; assert(isequal(x,y_correct) & isequal(num, num_correct));

y = 6 7 8 1 2 3 4 5 k = 8

2   Pass
x = [1 2 3 4 5]; y = 6; [x, num]=unshift(x, y); y_correct = [6 1 2 3 4 5]; num_correct = 6; assert(isequal(x,y_correct) & isequal(num, num_correct));

y = 6 1 2 3 4 5 k = 6

3   Pass
x = [1 2 3 4 5]'; y = [6 7 8]; [x, num]=unshift(x, y); y_correct = [6 7 8 1 2 3 4 5]'; num_correct = 8; assert(isequal(x,y_correct) & isequal(num, num_correct));

y = 6 7 8 1 2 3 4 5 k = 8 y = 6 7 8 1 2 3 4 5

4   Pass
x = []; y = [1 2 3]; [x, num]=unshift(x, y); y_correct = [1 2 3]; num_correct = 3; assert(isequal(x,y_correct) & isequal(num, num_correct));

y = 1 2 3 k = 3

Suggested Problems

More from this Author5