Uber Interview Question

String manipulation, recursive, complex calculations