package leetcode;

/**
 * https://leetcode.com/problems/maximum-of-absolute-value-expression/
 */
public class Problem1131 {
    public int maxAbsValExpr(int[] arr1, int[] arr2) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1131 prob = new Problem1131();
        System.out.println(prob.maxAbsValExpr(new int[]{1, 2, 3, 4}, new int[]{-1, 4, 5, 6})); // 13
        System.out.println(prob.maxAbsValExpr(new int[]{1, -2, -5, 0, 10}, new int[]{0, -2, -1, -7, -4})); // 20
    }
}

@@ -185,32 +185,328 @@
     
-// TODO%0A        return 0
+int answer = 0;%0A        for (int i = 0; i %3C arr1.length; i++) %7B%0A            for (int j = i + 1; j %3C arr2.length; j++) %7B%0A                int value = Math.abs(arr1%5Bi%5D - arr1%5Bj%5D) + Math.abs(arr2%5Bi%5D - arr2%5Bj%5D) + Math.abs(i - j);%0A                answer = Math.max(answer, value);%0A            %7D%0A        %7D%0A        return answer
 ;%0A  

Update problem 1131