Anonymous Interview Question

optimise the code written in coding round