Fractal interview question

Coding on Pyspark