Quantcast
Viewing latest article 2
Browse Latest Browse All 6

Answer by Neil for Double-reduce a sequence of integers

Charcoal, 24 bytes

⊞υ⁰FEΦθκ⁻ι§θκ≔⁺υ⁻ιυυIΦυκ

Try it online! Link is to verbose version of code. Explanation: Adapted from both @Arnauld's and @loopywalt's answers.

⊞υ⁰

Start with a list of just 0.

FEΦθκ⁻ι§θκ

Loop over the list of differences of the input array.

≔⁺υ⁻ιυυ

Subtract all of the elements of the output array from the current difference and then concatenate the result onto the output array.

IΦυκ

Output all but the first element of the output array.


Viewing latest article 2
Browse Latest Browse All 6

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>