Mettl Interview Question

Coding question