Company: wipro_7nov
Difficulty: medium
Find sum of all prime numbers in the array, except the largest prime number Problem Description Madhav has been assigned the task of finding the sum of all prime numbers in a given array, except the largest prime number in the array. Madhav approaches you to help him do this by writing a program. Given an array of numbers, you are expected to find the sum of all prime numbers in the given array. You must however exclude the largest prime number while performing this addition. public int findSumOfPrimes(int[] input1, int input2) Examples Example 1: Input: input1 = [10,41,18,50,43,31,29,25,59,96,67], input2 = 11 Output: 203 Explanation: The prime numbers in this array are 41, 43, 31, 29, 59 and 67. The largest prime number in this array is 67. So, let us leave out 67 and add all the other prime numbers to get the output. Therefore, output = 41+43+31+29+59 = 203. Constraints Special conditions to be taken care: If the array does NOT contain any prime number, the output should be the sum o