package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/sum-of-absolute-differences-in-a-sorted-array/
 */
public class Problem1685 {
    public int[] getSumAbsoluteDifferences(int[] nums) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1685 prob = new Problem1685();
        System.out.println(Arrays.toString(prob.getSumAbsoluteDifferences(new int[]{2,3,5}))); // [4,3,5]
        System.out.println(Arrays.toString(prob.getSumAbsoluteDifferences(new int[]{1,4,6,8,10}))); // [24,15,13,15,21]
    }
}

@@ -206,24 +206,69 @@
 t%5B%5D nums) %7B%0A
+        int%5B%5D answer = new int%5Bnums.length%5D;%0A
         // T
@@ -290,12 +290,14 @@
 urn 
-null
+answer
 ;%0A  
@@ -392,16 +392,122 @@
 1685();%0A
+        System.out.println(Arrays.toString(prob.getSumAbsoluteDifferences(new int%5B%5D%7B1,2,3%7D))); // %5B3,2,3%5D%0A
         

Update problem 1685