Scopely interview question

Gave small assignment to solve?