In this Kata, you will be given two positive integers `a` and `b` and your task will be to apply the following operations:

```
i) If a = 0 or b = 0, return [a,b]. Otherwise, go to step (ii);
ii) If a ≥ 2*b, set a = a - 2*b, and repeat step (i). Otherwise, go to step (iii);
iii) If b ≥ 2*a, set b = b - 2*a, and repeat step (i). Otherwise, return [a,b].
```

`a` and `b` will both be lower than 10E8.

More examples in tests cases. Good luck!

Please also try [Simple time difference](https://www.codewars.com/kata/5b76a34ff71e5de9db0000f2)

Difficulty: introductory

Starter code:

def solve(a,b):
	

Solutions:
def solve(a,b):
    if not (a and b): return [a, b]
    if a >= 2*b: return solve(a%(2*b), b)
    if b >= 2*a: return solve(a, b%(2*a))
    return [a, b]

def solve(a,b):
    '''
    Used the % operator instead of repeated subtraction of a - 2*b or b - 2*a
    Because as long as a > 2*b, the repeated subtraction has to be done and it will 
    eventually give a % 2*b. Repeated subtration in recursion has the problem of
    exceeding the recursion depth, so this approach is better
    '''
    if a == 0 or b == 0:
       return [a,b]
    elif a >= 2*b:
        return solve(a % (2*b), b)
    elif b >= 2*a:
        return solve(a, b % (2*a))
    else:
        return [a,b]


def solve(a, b):
    while a and b:
        if a >= b * 2:
            a %= 2 * b
        elif b >= a * 2:
            b %= 2 * a
        else:
            break
    return [a, b]

def solve(a,b):
    return ([a,b]           if not a or not b else
            solve(a%(2*b),b)  if a>=2*b else
            solve(a,b%(2*a))  if b>=2*a else
            [a,b])

def solve(a, b):
    while a and b:
        if a >= b*2 :     a = a%(b*2)
        elif b >= a * 2 : b = b%(a*2)
        else :            break
    return [a,b]

def solve(a,b):
    return [a,b] if a*b==0 or .5<a/b<2 else solve(a%(2*b), b%(2*a))

def solve(a,b):
    for _ in range(0,25):
        if b: a %= 2 * b
        if a: b %= 2 * a
    return [a,b]

def solve(a,b):
    while a and b and (a >= 2*b or b >= 2*a):
        if b: a %= 2 * b
        if a: b %= 2 * a
    return [a,b]

def solve(a,b):
    while a and b:
        if a >= 2*b:
            a -= (a//(2*b))*(2*b)
            print(a)
        elif b >= 2*a:
            b -= (b//(2*a))*(2*a)
        else:
            break
    return [a,b]   

def solve(a,b):
    if not (a and b):
        return [a, b]
    return solve(a % (2 * b), b) if a >= 2 * b else solve(a, b % (2 * a)) if b >= 2 * a else [a, b]