Skip to content

Instantly share code, notes, and snippets.

@mateusza
Created March 30, 2018 11:07
Show Gist options
  • Save mateusza/24ffcf15d6b3bf80e19c61c883b4d001 to your computer and use it in GitHub Desktop.
Save mateusza/24ffcf15d6b3bf80e19c61c883b4d001 to your computer and use it in GitHub Desktop.
( ( tab ) => tab
.map(
(v1,k1) => tab
.map( (v2,k2) => [v1,v2,k1,k2] )
.filter( p => p[2] < p[3] )
.map( p => [p[0],p[1]] )
)
.reduce(
(a,b) => [...a,...b]
)
)(
[ 0, [], "0", "\t" ]
).map(
(x) => [
x[0], x[1],
x[0] == x[1]
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment