Ejemplo n.º 1
0
        private static void ThreeSumTest()
        {
            Console.WriteLine("\n3 Sum question:");

            ThreeSum threeSum = new ThreeSum();

            IList <int[]> testNumberArrays = new List <int[]> {
                new int[] { -1, 0, 1, 2, -1, -4 }
            };

            foreach (int[] array in testNumberArrays)
            {
                Console.WriteLine("[{0}] -> [", string.Join(", ", array));

                IList <IList <int> > solution = threeSum.ThreeSumOne(array);
                foreach (List <int> set in solution)
                {
                    Console.WriteLine("[{0}],", string.Join(", ", set));
                }

                Console.WriteLine("]");
            }
        }