Ad
Code
Diff
  • from functools import reduce
    def find_max(arr):
        return reduce(lambda a, b: a if a > b else b, arr)
    • from functools import reduce
    • def find_max(arr):
    • max = 0
    • for i in range(len(arr)):
    • if arr[i] > max:
    • max = arr[i]
    • return max
    • return reduce(lambda a, b: a if a > b else b, arr)