package leetcode;

/**
 * https://leetcode.com/problems/best-sightseeing-pair/
 */
public class Problem1021 {
    public int maxScoreSightseeingPair(int[] A) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1021 prob = new Problem1021();
        System.out.println(prob.maxScoreSightseeingPair(new int[]{8, 1, 5, 2, 6})); // 11
    }
}

@@ -165,15 +165,240 @@
     
-// TODO
+int answer = 0;%0A        for (int i = 0; i %3C A.length; i++) %7B%0A            for (int j = i + 1; j %3C A.length; j++) %7B%0A                int val = A%5Bi%5D + A%5Bj%5D + i - j;%0A                answer = Math.max(answer, val);%0A            %7D%0A        %7D
 %0A   
@@ -409,17 +409,22 @@
  return 
-0
+answer
 ;%0A    %7D%0A

Update problem 1021