Function to find the number of times minimum and maximum value updated during the traversal of the given array
function maxUpdated ( arr ) { let h_score = arr [ 0 ] ; let l_score = arr [ 0 ] ; let i = 1 , j = 1 ;