human
I found an interesting problem on https://leetcode.com/problems/maximum-of-absolute-value-expression/:
Given two arrays of integers with equal lengths, return the maximum value of:
|arr1[i] - arr1[j]| + |arr2[i] - arr2[j]| + |i - j|
where the maximum is taken over all 0 <= i, j < arr1.length.
 
Example 1:
Input: arr1 = [1,2,3,4], arr2 = [-1,4,5,6]
Output: 13

Example 2:
Input: arr1 = [1,-2,-5,0,10], arr2 = [0,-2,-1,-7,-4]
Output: 20

 
Constraints:

2 <= arr1.length == arr2.length <= 40000
-10^6 <= arr1[i], arr2[i] <= 10^6

I tried it in Python, but could not do it. Can you solve it?
assistant
#Here is the Python program you requested.

class Solution:
    def maxAbsValExpr(self, A: List[int], B: List[int]) -> int:
        n = len(A)
        
        max1 = max2 = max3 = max4 = -10**6 - 1 
        min1 = min2 = min3 = min4 = 10**6 + 1
        for i in range(n):
            temp = A[i] - B[i] - i
            min1 = min(min1,temp)
            max1 = max(max1,temp)
            
            temp = A[i] + B[i] - i
            min2 = min(min2,temp)
            max2 = max(max2,temp)
                       
            temp = A[i] + B[i] + i
            min3 = min(min3,temp)
            max3 = max(max3,temp)
            
            temp = A[i] - B[i] +i
            min4 = min(min4,temp)
            max4 = max(max4,temp)
        
        ans = max(max4 - min4, max3 - min3, max2 - min2, max1 - min1)

        return ans