JPMorganChase interview question

Questions related to array and string manipulation