Skip to content

Instantly share code, notes, and snippets.

@alpox
Created April 17, 2021 22:04
Show Gist options
  • Save alpox/42e77f4d49dcd8d2dc0961ce2cae459d to your computer and use it in GitHub Desktop.
Save alpox/42e77f4d49dcd8d2dc0961ce2cae459d to your computer and use it in GitHub Desktop.
const cl = (e,a,s=[...new Set(e)],l=s.length,n=(i,v)=>v>=s[i]?n(i-1,v):i)=>a.reduce(([c,i],v,_,__,ni=n(i,v))=>[(c.push(ni+2),c),ni],[[],l-1])[0];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment