Beispiel #1
0
        public void Test220_3()
        {
            var sol = new _220ContainsDuplicateIII();
            var res = sol.ContainsNearbyAlmostDuplicate(
                new int[] { 1, 5, 9, 1, 5, 9 },
                2, 3
                );

            Assert.IsFalse(res);
        }
Beispiel #2
0
        public void Test220_2()
        {
            var sol = new _220ContainsDuplicateIII();
            var res = sol.ContainsNearbyAlmostDuplicate(
                new int[] { 1, 0, 1, 1 },
                1, 2
                );

            Assert.IsTrue(res);
        }
Beispiel #3
0
        public void Test220_4()
        {
            var sol = new _220ContainsDuplicateIII();
            var res = sol.ContainsNearbyAlmostDuplicate(
                new int[] { -1, 2147483647 },
                1,
                2147483647
                );

            Assert.IsFalse(res);
        }