Implement a cartesian product iterator with no repetitions
Vykstorm opened this issue · comments
Víctor Ruiz Gómez commented
Such iterator foo(X), will be equivalent to product(X) but with no duplicates:
Given two items A, B returned from foo, the indices of the values on both A and B in X will be different (the order doesnt matter)
foo([1, 2, 3, 4]) ->
(1, 1), (1, 2), (1, 3), (1, 4)
(2, 2), (2, 3), (2, 4)
(3, 3), (3, 4)
(4, 4)