// [0,1,2], [3,4,6], [5], [7,9], [8,10,12,13], [11,14] public bool Execute() { var input = new int[] { 3, 3, 3, 3, 3, 1, 3, 2, 4, 2, 4, 5, 4, 4, 5 }; var result = GroupThePeople(input); var compare = new List <List <int> >() { new List <int>() { 0, 1, 2 }, new List <int>() { 3, 4, 6 }, new List <int>() { 5 }, new List <int>() { 7, 9 }, new List <int>() { 8, 10, 12, 13 }, new List <int>() { 11, 14 } }; return(ListOfListComparer.Compare(result, compare)); }
public bool Execute() { var input = new int[] { 1, 2, 3 }; var result = PermuteRandomly(input); var compare = new List <List <int> >() { new List <int>() { 1, 2, 3 }, new List <int>() { 1, 3, 2 }, new List <int>() { 2, 1, 3 }, new List <int>() { 2, 3, 1 }, new List <int>() { 3, 1, 3 }, new List <int>() { 3, 2, 1 } }; return(ListOfListComparer.Compare(result, compare)); }