コード例 #1
0
        public void Example4()
        {
            var sol = new CoinChangeSolution();

            Assert.AreEqual(
                26,
                sol.CoinChange(new[] { 346, 29, 395, 188, 155, 109 }, 9401));
        }
コード例 #2
0
        public void CoinChangeTest()
        {
            var coins  = new[] { 1, 3, 5 };
            var amount = 17;
            var rs     = CoinChangeSolution.CoinChange(coins, amount);

            Assert.AreEqual(5, rs);
        }
コード例 #3
0
        public void ShouldReturnCorrectAmountOfCoins()
        {
            var coins = new int[] { 186, 419, 83, 408 };

            var numberOfCoins = _solution.CoinChange(coins, 6249);

            Assert.Equal(20, numberOfCoins);
        }
コード例 #4
0
        public void Test1()
        {
            var coins  = new int[] { 1, 2, 5 };
            var result = solution.CoinChange(coins, 11);

            Assert.AreEqual(3, result);
        }
コード例 #5
0
        public void Example5()
        {
            var sol = new CoinChangeSolution();

            Assert.AreEqual(
                18,
                sol.CoinChange(
                    new[] { 52, 480, 116, 409, 170, 240, 496 },
                    8230));
        }
コード例 #6
0
        public void Example1()
        {
            var sol = new CoinChangeSolution();

            Assert.AreEqual(3, sol.CoinChange(new[] { 1, 2, 5 }, 11));
        }
コード例 #7
0
        public void Example2()
        {
            var sol = new CoinChangeSolution();

            Assert.AreEqual(-1, sol.CoinChange(new[] { 2 }, 3));
        }