Пример #1
0
        public static void FindTheSubsetOfSum()
        {
            var obj = new CareerCupQnA();
            var res = obj.FindTheSubsetOfSum(new List <int> {
                1, 2, 3, 4, 5
            }, 7);

            foreach (var e in res)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine("**************************");
            res = obj.FindTheSubsetOfSum(new List <int> {
                1, 2, 3, 4, 5, 6, 7, 9
            }, 8);

            foreach (var e in res)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine("**************************");
            res = obj.FindTheSubsetOfSum(new List <int> {
                1, 11, 22, 33, 44, 55, 66, 77, 88, 99
            }, 100);

            foreach (var e in res)
            {
                Console.WriteLine(e);
            }
        }