Sum of Absolute Differences in a Sorted Array — CaffeCode