Grid Dynamics Interview Question

Live coding with typical algo task