Let be `n` an integer prime with `10` e.g. `7`. 

`1/7 = 0.142857 142857 142857 ...`.

We see that the decimal part has a cycle: `142857`. The length of this cycle is `6`. In the same way:

`1/11 = 0.09 09 09 ...`. Cycle length is `2`.

# Task

Given an integer n (n > 1), the function cycle(n) returns the length of the cycle if n and 10 are coprimes, otherwise returns -1.

# Examples:
```
cycle(5) = -1
cycle(13) = 6 -> 0.076923 076923 0769
cycle(21) = 6 -> 0.047619 047619 0476
cycle(27) = 3 -> 0.037 037 037 037 0370
cycle(33) = 2 -> 0.03 03 03 03 03 03 03 03
cycle(37) = 3 -> 0.027 027 027 027 027 0
cycle(94) = -1 

cycle(22) = -1 since 1/22 ~ 0.0 45 45 45 45 ...
```

Difficulty: introductory

Starter code:

def cycle(n) :
	

Solutions:
import math

def cycle(n) :
    if n % 2 == 0 or n % 5 ==0:
        return -1
    k = 1
    while pow(10,k,n) != 1:
        k += 1
    return k
            
    
       


def cycle(n):
    if not n % 2 or not n % 5:
        return -1
    x, mods = 1, set()
    while x not in mods:
        mods.add(x)
        x = 10 * x % n
    return len(mods)

def cycle(n):
    if n%5==0 or n%2==0:
        return -1
    remainders, r = [1], 0
    while r != 1:
        r = remainders[-1] * 10 % n
        remainders.append(r)
    return len(remainders)-1

def cycle(n) :
    if n % 2 and n % 5:
        for i in range(1, n):
            if pow(10, i, n) == 1:
                return i
    return -1

def cycle(n):
    if n % 2 == 0 or n % 5 == 0:
        return  -1
    m = 1
    for p in range(1, n):
        m = 10 * m % n
        if m == 1: 
            return p

def cycle(n):
    if not (n%2 and n%5): return -1
    return next(filter(lambda x: pow(10, x, n) == 1, range(1, n)))

def cycle(n) :
    if not n % 2 or not n % 5:
        return -1
    m, s = 1, set()
    while m not in s:
        s.add(m)
        m = 10 * m % n
    return len(s)

from math import ceil, log10

def cycle(d):
    if d % 5 == 0 or d % 2 == 0:
        return -1

    n = 10 ** int(ceil(log10(d)))
    first = n % d
    n *= 10
    for i in range(99999999):
        n %= d
        if n == first:
            return i + 1
        n *= 10

def cycle(n) :
    if n%2 == 0 or n%5 == 0:
        return -1
    c = len(str(n))
    m = 10**c % n
    while m != 1:
        c += 1
        m = (m*10) % n
    return c


def cycle(i):
  if(i%2==0 or i%5==0):
    return -1
  
  gen = 10
  n = 1
  while(gen%i != 1):
    gen = (gen % i) * 10
    n = n + 1
    
  return n