Problem

Return arr[i+1]-arr[i] summed (length>=2).

Examples

  • differenceArray([1, 4, 8]) -> 7
Compile and test (Ctrl+Enter)