you give 0indexed array num comprise n nonnegative integersIn operation mustchoose integer 1 n numsi 0decrease numsi 1increase numsi 1 1Return minimum possible value maximum integer num perform number operation Example 1input num 3716output 5explanationone set optimal operation follows1 choose 1 num 46162 choose 3 num 46253 choose 1 num 5525the maximum integer num 5 it show maximum number 5therefore return 5example 2input num 101Output 10explanationit optimal leave num 10 maximum value return 10 Constraintsn numslength2 n 1050 numsi 109