Quantcast
Channel: Double-reduce a sequence of integers - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 6

Answer by loopy walt for Double-reduce a sequence of integers

$
0
0

Python, 63 bytes

f=lambda l,*L,a=[]:L and f(*L,a=a+[L[0]-l-b for b in[0]+a])or a

Attempt This Online!

Takes splatted input. Returns the entire double-reduction.

How?

Once one all but ignores the confusing double indexing there is an obvious rather simple recursion.


Viewing all articles
Browse latest Browse all 6

Trending Articles



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