3 ms·
Guy Steele's talk came up here: https://news.ycombinator.com/item?id=30462835 https://news.ycombinator.com/item?id=30462835 with an APL solution of: +/((⌽
by jodrellblank 4y ago
Guy Steele's talk came up here: https://news.ycombinator.com/item?id=30462835 https://news.ycombinator.com/item?id=30462835 with an APL solution of:
+/((⌽⌈\⌽a)⌊⌈\a)-a
with comment that it could "be fully parallelizable and run fast on the GPU, as it's based on a couple scan (generalized prefix sum) operations". Some explanation in my reply there.