Upside-Down Pyramid Addition...REVERSED! Upside-Down Pyramid Addition is the process of taking a list of numbers and consecutively adding them together until you reach one number.

When given the numbers 2, 1, 1 the following process occurs:

 2   1   1
   3   2 
     5


This ends in the number 5.



YOUR TASK

Given the right side of an Upside-Down Pyramid (Ascending), write a program or function that will return the original list.

New Extra Challenge: Try doing this in less than O(n^2)

EXAMPLE

f([5, 2, 1]) =&gt; [2, 1, 1]
f([84,42,21,10,2]) =&gt; [4,7,3,8,2]


NOTE: The Upside-Down Pyramid will never be empty and will always consist of positive integers ONLY.
JavaScript (ES6),  62 58 49  46 bytes
Saved 3 bytes thanks to @Oliver
Returns the list as a comma-separated string.

f=a=&gt;+a||f(a.map(n=&gt;a-(a=n),a=a.shift()))+[,a]

Try it online!
Commented
f = a =&gt;              // f = recursive function taking the input list a[]
  +a                  // if a[] consists of a single positive integer:
                      //   stop recursion and return this integer
  ||                  // else:
    f(                //   do a recursive call to f:
      a.map(n =&gt;      //     for each value n in a[]:
        a - (a = n),  //       yield the difference between the previous value and n
                      //       and update a to n
        a = a.shift() //       start by removing the first element and saving it in a
                      //       (because of the recursion, it's important here to reuse
                      //       a variable which is defined in the scope of f)
      )               //     end of map()
    )                 //   end of recursive call
    + [, a]           //   append the last entry from a[]