<prompt> Kujenga algorithm ya kupata thamani ya juu katika safu ya idadi.3, 5, 7, 2  <response>: Here is an algorithm to find the maximum value in an array of numbers:1. Initialize the first element of the array as the maximum value.2. Loop through the rest of the array, comparing each element with the current maximum value.3. If the current element is greater than the current maximum value, update the maximum value with the current element.4. Continue looping through the array until all elements have been checked.5. Return the maximum value.Pseudocode:function findMaxValuearray let maxValue array0; for let i 1; i array.length; i if arrayi maxValue maxValue arrayi; return maxValue;Example implementation in Python:pythondef find_max_valuearr: max_value arr0 for i in range1, lenarr: if arri max_value: max_value arri return max_value Test the function with the provided inputarr 3, 5, 7, 2printfind_max_valuearr Output: 7 