16
1
The Challenge
Given a finite list of integers, split it into the fewest partitions possible such that no partition contains a number more than once.
Rules
Input can be in any format and any order.
Output can be in any format, as long as it's clear that each group is separate.
This is code-golf, so lowest score wins!
Example I/O
Input: [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2]
Output: [[1,2],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1],[1]]
Input: [1,3,4,2,6,5,1,8,3,8]
Output: [[1,3,4,2,6,5,8],[1,3,8]]
Input: [5,9,12,5,2,71,23,4,7,2,6,8,2,4,8,9,0,65,4,5,3,2]
Output: [[5,9,12,2,71,23,4,7,6,8,0,65,3],[5,4,8,9,2],[4,5,2],[2]]
2Could you clarify a bit what you mean by splitting? Does it matter the order of the original list when splitting? – Post Rock Garf Hunter – 2019-12-21T14:51:12.477
The order of the original list does not matter. I'm not quite sure how I can make "splitting" any clearer; the Example I/O may help you understand what I mean. – Corsaka – 2019-12-21T15:39:48.393
7You can just mention that the order of the original list does not matter. The test cases do preserve order to some extent so they are not really helpful in the deduction. Plus a clear spec is always better than examples. – Post Rock Garf Hunter – 2019-12-21T16:26:52.900
3Is it interpretator or interpreter? – S.S. Anne – 2019-12-21T23:07:34.997
1Also, how big do the integers have to be? Can we restrict them to a certain size? – S.S. Anne – 2019-12-21T23:08:27.893
This should work with any size integer. – Corsaka – 2019-12-24T15:15:15.223