Mindera Interview Question

Resolve a problem in Kotlin