user
Write an algorithm that determines the maximum number of elements in a given array.


assistant
// Function to determine maximum element in an array 
def findMax(arr, n): 
    max = arr[0] 
  
    for i in range(1, n): 
        if arr[i] > max: 
            max = arr[i] 
    return max