JPMorganChase Interview Question

String manipulation using arrays with Python