Please Write Java Array List 5 Sum X Problem Return Sum Extreme Largest Smallest Values In Q37272687

Please write in Java and Array List

5 THE SUM X PROBLEM

Return the sum of the extreme (largest and smallest) values inthe int array nums. If there are no values in the array, thenreturn -1.

sumX({9, 5, 1, 3 7}) → 10 // (9 + 1)

sumX({5}) → 10 // (5 + 5)

sumX({}) → -1

6 THE COUNT DIFF PROBLEM

Start with 1 String array wordList and one String word. Yourmethod should calculate and return the number of words that aredifferent from word in the array wordList.

countDiff({“a”, “a”, “b”, “c”}, “a”) → 2 // (b and c)

countDiff({“a”, “a”, “b”, “c”}, “c”) → 3 // (a,

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.