Sort the arrays in descending order
arr1 . sort ( ) ; arr1 . reverse ( ) ; arr2 . sort ( ) ; arr2 . reverse ( ) ; arr3 . sort ( ) ; arr3 . reverse ( ) ; return getMaxSum ( 0 , 0 , 0 , arr1 , arr2 , arr3 ) ; }