Ejemplo n.º 1
0
        public void KthFalseDay_2()
        {
            var period   = 9L;
            var trueDays = new long[] { 1, 5, 8 };

            void Test(long expected, long k)
            {
                Assert.AreEqual(expected, GreedyHelper.KthFalseDay(k, period, trueDays));
            }

            var es = new long[] { 0, 2, 3, 4, 6, 7, 9, 11, 12, 13, 15, 16, 18, 20 };

            for (int i = 0; i < es.Length; i++)
            {
                Test(es[i], i);
            }
        }
Ejemplo n.º 2
0
        public void KthFalseDay_1()
        {
            var period   = 9L;
            var trueDays = new long[] { 0, 2, 6 };

            void Test(long expected, long k)
            {
                Assert.AreEqual(expected, GreedyHelper.KthFalseDay(k, period, trueDays));
            }

            var es = new long[] { 1, 3, 4, 5, 7, 8, 10, 12, 13, 14, 16, 17, 19, 21 };

            for (int i = 0; i < es.Length; i++)
            {
                Test(es[i], i);
            }
        }