answer to the first test case should be 205
and for third test case should be 558
as question given as summing all digits except the digit mention as 'm'
the problem means to exclude all numbers with the digit 'm'
so example n=20, m=5, you exclude numbers 5 and 15 as these contains the digit m=5.
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
n = 20;
m = 5;
total = 190;
assert(isequal(no_digit_sum(n,m),total))
s =
210
s =
205
|
2 | Pass |
n = 10;
m = 5;
total = 50;
assert(isequal(no_digit_sum(n,m),total))
s =
55
s =
50
|
3 | Fail |
n = 33;
m = 3;
total = 396;
assert(isequal(no_digit_sum(n,m),total))
s =
561
s =
558
|
Test if a Number is a Palindrome without using any String Operations
181 Solvers
Solve the set of simultaneous linear equations
273 Solvers
Find the maximum number of decimal places in a set of numbers
737 Solvers
Implement simple rotation cypher
943 Solvers
518 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!