It seems that only Data.List.permutations is forbidden, therefore this still works!
That was helpful. Thank you
Now that is elegant.
the newer test cases forbid using functions from Data.List - so this will not work anymore
This comment is hidden because it contains spoiler information about the solution
totally underrated solution