give integer array num return distinct maximum number array if maximum exist return maximum number example 1input num 321Output 1explanationthe distinct maximum 3the second distinct maximum 2the distinct maximum 1example 2input num 12Output 2explanationthe distinct maximum 2the second distinct maximum 1the distinct maximum exist maximum 2 return insteadExample 3input num 2231output 1explanationthe distinct maximum 3the second distinct maximum 2 2s count valueThe distinct maximum 1 constraints1 numslength 104231 numsi 231 1 Follow can find on solution