9:17 PM
@JonathanAllan hm, I also have another concern with your jelly answer
here, specifically that you appear to assume that the cartesian power list is already sorted in a particular order which will return the shortest possible result by taking its head and removing 1s, while it's perfectly possible for
[1,2,3,2]
to be before
[1,4,1,1]
for
24!
and so your result to be [2,3,2]
instead of [4]
(although for some reason it still returns [4]
for that particular example)
hm, one may argue that if [1,4,1,1]
appears then [1,1,1,4]
will also appear before [1,2,3,2]
so then we can consider [1,1,1,1], [1,1,1,2], [1,1,1,3], ..., [1,1,1,24], [1,1,2,2], ...
while ignoring [1,1,2,1], [1,1,3,1], [1,1,3,2], [1,1,4,1], ..., [1,1,24,23], [1,2,1,1], ..., [1,2,3,2], ...
I think I may use that sneaky trick next time :P
keeping this as proof it works on that part