<prompt> Specify an algorithm to find the maximum sum in a given array.1,2,3,4  <response>: An algorithm to find the maximum sum in a given array is described below:1. Begin by initializing a variable max_sum to the first element in the array.2. Create another variable current_sum and also set it to the value of the first element.3. Loop through the array, start from the second element, and follow the below-given conditions. For each i-th iteration: - If the current_sum 0, then set current_sum to arrayi. - Otherwise, accumulate the value on current_sum by adding the arrayi current_sum arrayi. - Compare current_sum against the max_sum, if it is greater, then update the value of max_sum.4. Return the value held by max_sum.For the given input 1, 2, 3, 4, the maximum sum would be 10 which is achieved from adding all elements in the array.Here is the implementation in Python:pythondef max_sumarray: max_sum current_sum array0 for i in range1,lenarray: current_sum maxarrayi, current_sum arrayi max_sum maxmax_sum, current_sum return max_sum 