Problem 45782. Upstairs!

Solution 2501813

Submitted on 9 Jun 2020 by Binbin Qi
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 = [5,10,20] len = [8 89 10946]; for i = 1 : length(x) y = upstairs(x(i)); assert(isequal(unique(cell2mat(y)),1:2)); assert(isequal(length(unique(cellfun(@num2str,y,'UniformOutput',false))),len(i))); assert(isequal(unique(cellfun(@sum,y)),x(i))); end

x = 5 10 20

Suggested Problems

More from this Author17

Community Treasure Hunt

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

Start Hunting!