Infobip interview question

Write a code for a simple task.