Cody

Problem 46122. Find the nth term in the digit inventory sequence

Solution 3017428

Submitted on 1 Oct 2020 by James
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
n = 1; y1 = 8; y_correct = '8'; assert(isequal(digitInventory(n,y1),y_correct))

2   Pass
n = 6; y1 = 8; y_correct = '31121318'; assert(isequal(digitInventory(n,y1),y_correct))

3   Pass
n = 11; y1 = 8; y_correct = '3122331418'; assert(isequal(digitInventory(n,y1),y_correct))

4   Pass
n = 12; y1 = 8; y_correct = '3122331418'; assert(isequal(digitInventory(n,y1),y_correct))

5   Pass
n = 13; y1 = 1; y_correct = '21322314'; assert(isequal(digitInventory(n,y1),y_correct))

6   Pass
n = 53; y1 = 1; y_correct = '21322314'; assert(isequal(digitInventory(n,y1),y_correct))

7   Pass
n = 8; y1 = 46122; y_correct = '3122331416'; assert(isequal(digitInventory(n,y1),y_correct))

8   Pass
n = 5; y1 = 1234567890; y_correct = '101112213141516171819'; assert(isequal(digitInventory(n,y1),y_correct))

9   Pass
n = 53; y1 = 1234567890; y_correct = '101112213141516171819'; assert(isequal(digitInventory(n,y1),y_correct))

10   Pass
n = 9; y1 = 134567890; y_correct = '10714213141516172819'; assert(isequal(digitInventory(n,y1),y_correct))

11   Pass
n = 10; y1 = 134567890; y_correct = '10812213241516271819'; assert(isequal(digitInventory(n,y1),y_correct))

12   Pass
n = 53; y1 = 134567890; y_correct = '10714213141516172819'; assert(isequal(digitInventory(n,y1),y_correct))

13   Pass
n = 54; y1 = 134567890; y_correct = '10812213241516271819'; assert(isequal(digitInventory(n,y1),y_correct))

Suggested Problems

More from this Author50

Community Treasure Hunt

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

Start Hunting!