コード例 #1
0
        public void Find_Fewest_Coins_test()
        {
            int[] coins   = new int[] { 3, 6, 8 };
            int   summary = 9;
            int   result  = CSI_Interview_Questions.CoinsChanges_Dynamic(coins, coins.Length - 1, summary);

            Assert.AreEqual(result, 1);
        }
コード例 #2
0
        public void Find_Triplets_test()
        {
            int[]        arr    = new int[] { -1, 0, 1, 2, -1, -4 };
            var          result = CSI_Interview_Questions.FindTriplets(arr);
            List <int[]> output = new List <int[]>();

            output.Add(new int[] { -1, -1, 2 });
            output.Add(new int[] { -1, 0, 1 });

            Assert.AreEqual(result, output);
        }