Solve server updates and grid inconvenience minimization | Amazon Interview Question