Bright Data Interview Question

Simplify function