It seems that any Simple Modification of deltas using a consistent function can almost always be done some other shorter way, Dennis. Thus, the only solution I can imagine to make this harder, is to introduce some sort of inconsistent function.
Sorting.
Your task is to take an array of integers, sort their deltas, and recompile that to give the new array of integers.
EG.
For the input:
1 5 -3 2 9
Get the following Deltas:
4 -8 5 7
Then, sort these Deltas, Yielding:
-8 4 5 7
And reapply them, which gives:
1 -7 -3 2 9
Input/Output
You will be given a list/array/table/tuple/stack/etc. of signed integers as input through any standard input method.
You must output the modified data once again in any acceptable form, following the above delta sorting method.
You will receive N inputs where 0 < N < 10
where each number falls within the range -1000 < X < 1000
Test Cases
1 5 -3 2 9 -> 1 -7 -3 2 9
-5 -1 -6 5 8 -> -5 -10 -7 -3 8
-8 1 -7 1 1 -> -8 -16 -16 -8 1
8 -9 3 0 -2 -> 8 -9 -12 -14 -2
-5 -2 -5 5 0 -> -5 -10 -13 -10 0
-1 9 -1 -7 9 -> -1 -11 -17 -7 9
Notes
- As stated in above, you will always receive at least 1 input, and no more than 9.
- The first and last number of your output, will always match that of the input.
- Only Standard Input Output is accepted
- Standard loopholes apply
- This is code-golf, so the lowest byte-count wins!
- Have fun!