Mariner Finance interview question

Python coding question involving string manipulation