Fidelity Investments Interview Question

Seven "ate" nine on CodeWars (6kyu)