Getting all possible combinations of a List of KeyValue Pairs in C#
问题 I have a key value pair like this: var accounts = new List<KeyValuePair<int,int>>(); and the contents of accounts looks like this: {[4,10000]} {[4,19000]} {[4,11000]} {[4,12000]} {[4,13036]} {[4,47100]} {[5,19300]} {[5,32900]} {[5,95800]} {[6,95800]} How can I get all possible combinations of the key value pairs in accounts such that I have: [{4,10000},{5,19300},{6,95800}], [{4,10000},{5,32900},{6,95800}]..... The data structure containing the final result is not of much importance to me, I'm