Cody

Problem 45782. Upstairs!

Solution 2500877

Submitted on 8 Jun 2020 by Tim
  • Size: 53
  • This is the leading solution.
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