Mettl interview question

Coding question