Find the maximum element in an array
Asked in the technical interview 1 stage. Basic coding.
Implement max_element(nums) to return the largest integer in the non-empty array nums. The function must return an integer and should solve the problem without sorting the array.
Input: a non-empty list of integers. Output: the maximum integer in the list.
Constraints: 1 <= len(nums) <= 1000; -10^9 <= nums[i] <= 10^9.
def max_element(nums):