Cody

Problem 918. Find the repeating decimal pattern!

Solution 765113

Submitted on 20 Oct 2015
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
%% assert(isequal(repeatingdec(1),'0'))

Assertion failed.

2   Fail
%% assert(isequal(repeatingdec(3/7),'428571'))

Assertion failed.

3   Fail
%% assert(isequal(repeatingdec(.3456345612323),''))

Assertion failed.

4   Fail
%% assert(isequal(repeatingdec(1/pi),''))

Assertion failed.

5   Fail
%% assert(isequal(repeatingdec(1/13),'076923'))

Assertion failed.

6   Fail
%% assert(isequal(repeatingdec(2/33),'06'))

Assertion failed.

7   Fail
%% assert(isequal(repeatingdec(.789789789789789789),'789'))

Assertion failed.

8   Fail
%% assert(isequal(repeatingdec(.78978978938383838),''))

Assertion failed.

9   Fail
%% assert(isequal(repeatingdec(1/exp(1)),''))

Assertion failed.

10   Fail
%% assert(isequal(repeatingdec(.78787878787833333),''))

Assertion failed.

11   Fail
%% assert(isequal(repeatingdec(.123451234512345),'12345'))

Assertion failed.

12   Fail
%% assert(isequal(repeatingdec(1/100),''))

Assertion failed.

13   Fail
%% assert(isequal(repeatingdec(1/62),''))

Assertion failed.

14   Fail
%% assert(isequal(repeatingdec(1/16),''))

Assertion failed.

15   Fail
%% assert(isequal(repeatingdec(1/91),'010989'))

Assertion failed.

16   Fail
%% assert(isequal(repeatingdec(0),'0'))

Assertion failed.

Suggested Problems

More from this Author6