THG Ingenuity Interview Question

How I approached the task