Exemple #1
0
        private List <IList <ulong> > GenWeightCombos(ulong targetWeight, ulong[] nums)
        {
            List <IList <ulong> > weightCombos = new List <IList <ulong> >();

            for (int i = 2; i < input.Length; i++)
            {
                foreach (var wc in Permutator.Combinations(i, nums))
                {
                    if (Sum(wc) == targetWeight)
                    {
                        weightCombos.Add(wc);
                    }
                }
                if (weightCombos.Count != 0)
                {
                    break;
                }
            }
            return(weightCombos);
        }