Fractal interview question

(For some candidates) Can you solve this coding problem? (Easy to average difficulty)