American Express Interview Question

4 String related coding questions (very easy, but need to write functions down on the paper). Encounter problem