예제 #1
0
        public void SecondArray_SecondApproach_Success()
        {
            int[] arr    = { 9, 6, 4, 2, 3, 5, 7, 0, 1 };
            var   sol    = new MissingNumber(arr);
            var   result = sol.GetMissingNumberBits();

            Assert.AreEqual(8, result);
        }
예제 #2
0
        public void NullOremptyArray_Success()
        {
            int[] arr    = null;
            var   sol    = new MissingNumber(arr);
            var   result = sol.GetMissingNumner();

            Assert.AreEqual(-1, result);
        }
예제 #3
0
        public void FirstArray_Success()
        {
            int[] arr    = { 3, 0, 1 };
            var   sol    = new MissingNumber(arr);
            var   result = sol.GetMissingNumner();

            Assert.AreEqual(2, result);
        }