Cody

Problem 45249. Frugal number

Solution 2199437

Submitted on 8 Apr 2020 by Payam Morsali
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; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 49 f = 49 b = 1 y = logical 0

2   Pass
n = 18; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 51 f = 50 51 b = 2 y = logical 0

3   Pass
n = 36; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 51 f = 50 51 b = 2 y = logical 0

4   Pass
n = 79; y_correct = 0; assert(isequal(frugal_no(n),y_correct))%% n = 105; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 55 57 f = 55 57 b = 2 y = logical 0 f = 51 32 32 53 32 32 55 f = 51 53 55 b = 3 y = logical 0

5   Pass
n = 106; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 53 51 f = 50 53 51 b = 3 y = logical 0

6   Pass
n = 125; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 53 f = 53 b = 1 y = logical 1

7   Pass
n = 128; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 50 f = 50 b = 1 y = logical 1

8   Pass
n = 243; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 51 f = 51 b = 1 y = logical 1

9   Pass
n = 344; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 52 51 f = 50 52 51 b = 3 y = logical 0

10   Pass
n = 11421; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 51 32 32 52 55 f = 51 52 55 b = 3 y = logical 1

11   Pass
n = 115248; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 51 32 32 55 f = 50 51 55 b = 3 y = logical 1

12   Pass
n = 111050; y_correct = 0; assert(isequal(frugal_no(n),y_correct))

f = 50 32 32 32 32 32 53 32 32 50 50 50 49 f = 50 53 50 50 50 49 b = 6 y = logical 0

13   Pass
n=97969; y_correct = 1; assert(isequal(frugal_no(n),y_correct))

f = 51 49 51 f = 51 49 51 b = 3 y = logical 1

Suggested Problems

More from this Author149

Community Treasure Hunt

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

Start Hunting!