ZS Associates Interview Question

How I attempted the ML question asked in CBT