Fidelity Investments interview question

Seven "ate" nine on CodeWars (6kyu)