<prompt> Create an algorithm that finds the sum of the two largest numbers in an array.2, 4, 9, 1, 10  <response>: Here is a simple algorithm in Python that you can use to find the sum of the two largest numbers in an array:1. Start by initializing the first and the second largest numbers to float-inf because initially there is no maximum value.pythonfirst_max second_max float-inf2. Iterate through the given array of numbers to find the two largest numbers.pythonfor num in nums: if num first_max: If the current number is greater than the first maximum value, Update the first and second maximum values. first_max, second_max num, first_max elif first_max num second_max: If the current number is greater than the second maximum value, Update the second maximum value second_max num3. Once the two largest numbers have been identified, you can calculate the sum and return the result.pythonresult first_max second_maxreturn resultCombining all the above steps, here is the full Python algorithm to find the sum of the two largest numbers in an array:pythondef sum_of_two_largestnums: first_max second_max float-inf for num in nums: if num first_max: first_max, second_max num, first_max elif first_max num second_max: second_max num result first_max second_max return resultLets test the algorithm using the input provided: 2, 4, 9, 1, 10pythonnums 2, 4, 9, 1, 10printsum_of_two_largestnums 19 