JPMorganChase Interview Question

Something to do with arrays and string slicing