Cody

Problem 44909. Reepeating numbers in array

Solution 3025060

Submitted on 1 Oct 2020 at 23:47 by Alfonso Nieto-Castanon
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 0]; y_correct = [1 1]; assert(isequal(repeatNumberbyzeros(x),y_correct))

2   Pass
x = [-1 0 0 -2 0 0 0 5 0 0 0 0 ]; y_correct = [-1 -1 -1 -2 -2 -2 -2 5 5 5 5 5]; assert(isequal(repeatNumberbyzeros(x),y_correct))

Suggested Problems

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!