elijah seed-arita @elij.dev 路 Nov 11 an improvement inspired by @allandeutsch.com's reply, which avoids excessive array allocations :D 3 likes 3 replies ? Reply Replies 饾暜 路 Nov 12 I'd go down the imperative route, should be more performant and less code to grok Allan Deutsch 路 Nov 11 Now try it in a single pass over the array 馃榿 elijah seed-arita 路 Nov 11 also, spot the bug lol