A solution in Dyalog APL: (In APL-Terminology, these "arrays" are called "vectors" and I'm using the default notation for 'em. It would also be possible to pass a JSON-Array, but that'd 5 more characters!)
solve← {×/≢¨∪¨⍵}
using it:
solve(1 2)(4)(5 6) 4 solve(1 2)(4)(5 5 6) 4 solve(1 2)(4 4)(5 6 6) 4 solve(1 2)(3 4)(5 6) 8 solve(1 2 3)(3 4 6 6 7)(8 9 10 12 5 6) 72
Try it online!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
A solution in Dyalog APL:
(In APL-Terminology, these "arrays" are called "vectors" and I'm using the default notation for 'em. It would also be possible to pass a JSON-Array, but that'd 5 more characters!)
using it:
Try it online!