Turing Interview Question

Both questions were Strings based