[ ASSIGNMENT: ] Transform To Prime
TASK: GivenĀ a List[ ] of n integers, find minimum number to beĀ insertedĀ in aĀ list, so thatĀ sum of all elements of listĀ shouldĀ equal the closest prime number. NOTE! - List sizeĀ isĀ at least 2. - List's numbersĀ will onlyĀ positivesĀ (n > 0). - RepeatitionĀ of numbers in the listĀ could occur. - The newer list's sumĀ shouldĀ equal the closest prime number. Example #1 minimumNumber({3, 1, 2}) --> return (1) Explanation: Since,Ā the sumĀ of the list's elements equal toĀ (6), the minimum number to be inserted to transform the sum to prime numberĀ isĀ (1), which will make the sum of the ListĀ equal the closest prime numberĀ (7). Example #2 minimumNumber({2,12,8,4,6})-->return (5) Explanation: Since,Ā the sumĀ of the list's elements equal toĀ (32), the minimum number to be inserted to transform the sum to prime numberĀ isĀ (5), which will make the sum of the ListĀ equal the closest prime number (37). HappyCodings!:) https://code.sololearn.com/WBTmxnVI7fYR/?ref=app