Cody

Problem 44067. The last non-zero digit of a factorial

Solution 3629288

Submitted on 12 Nov 2020
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   Fail
n = 4; d_correct = 4; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

2   Fail
n = 5; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

3   Fail
n = 6; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

4   Fail
n = 7; d_correct = 4; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

5   Fail
n = 8; d_correct = 2; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

6   Fail
n = 9; d_correct = 8; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

7   Fail
n = 10; d_correct = 8; assert(isequal(lastNonZeroDigitFactorial(n),d_correct))

Assertion failed.

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!