ION Group Interview Question

Python coding, puzzles from geeks for geeks