Consider the following expansion:
```Haskell
solve("3(ab)") = "ababab" -- "ab" repeats 3 times
solve("2(a3(b))" = "abbbabbb" -- "a3(b)" == "abbb" repeats twice.
```
Given a string, return the expansion of that string. 
Input will consist of only lowercase letters and numbers (1 to 9) in valid parenthesis. There will be no letters or numbers after the last closing parenthesis.
More examples in test cases. 
Good luck!
Please also try [Simple time difference](https://www.codewars.com/kata/5b76a34ff71e5de9db0000f2)
import re

def solve(s):
    ops, parts = [], ['']
    for c in re.findall(r'\d*\(|\)|[a-z]+', s):
        if c == ')':
            segment = parts.pop()
            parts[-1] += ops.pop()*segment
        elif not c[0].isalpha():
            ops.append(int(c[:-1]) if c[0] != '(' else 1)
            parts.append('')
        else:
            parts[-1] += c
    return parts[0]
import re

def solve(s):
    ops, parts = [], ['']
    for c in re.findall(r'\d*\(|\)|[a-z]+', s):
        if c == ')':
            segment = parts.pop()
            parts[-1] += ops.pop()*segment
        elif not c[0].isalpha():
            ops.append(int(c[:-1]) if c[0] != '(' else 1)
            parts.append('')
        else:
            parts[-1] += c
    return parts[0]