you n computer you give integer n 0indexed integer array battery ith battery run computer batteriesi minute you interest running n computer simultaneously give batteriesinitially insert battery computer after integer time moment remove battery computer insert battery number time the insert battery totally new battery battery computer you assume remove insert process timenote battery rechargedreturn maximum number minute run n computer simultaneously example 1input n 2 battery 333output 4explanation initially insert battery 0 computer battery 1 second computerafter minute remove battery 1 second computer insert battery 2 instead note battery 1 run minuteAt end minute battery 0 drain need remove computer insert battery 1 insteadBy end fourth minute battery 1 drain computer long runningwe run computer simultaneously 4 minute return 4example 2input n 2 battery 1111output 2explanation initially insert battery 0 computer battery 2 second computer after minute battery 0 battery 2 drain need remove insert battery 1 computer battery 3 second computer after minute battery 1 battery 3 drain second computer long runningwe run computer simultaneously 2 minute return 2 Constraints1 n batterieslength 1051 batteriesi 109