Vodafone interview question

A task was given to submit beforehand.