iFIT interview question

2 Hacker Rank Code questions - pretty easy