you give integer array num you integer array arr length value set 0 initially you follow modify functionYou want use modify function covert arr nums minimum number callsreturn minimum number function call num arrthe test case generate answer fit 32bit sign integer Example 1input num 15output 5explanation Increment 1 second element 0 0 0 1 1 operationdouble element 0 1 0 2 0 4 2 operationsincrement 1 element 0 4 1 4 1 5 2 operationstotal operation 1 2 2 5example 2input num 22output 3explanation Increment 1 element 0 0 0 1 1 1 2 operationsdouble element 1 1 2 2 1 operationtotal operation 2 1 3example 3input num 425output 6explanation initial000 100 101 202 212 424 425num Constraints1 numslength 1050 numsi 109