Ejemplo n.º 1
0
        public void CanFinishTest()
        {
            var s = new Solution();
            int numCourses;

            int[][] prerequisites;

            numCourses    = 2;
            prerequisites = Create2dArray(2, 1, 0);
            // Assert.True(s.CanFinish(numCourses, prerequisites));

            numCourses    = 2;
            prerequisites = Create2dArray(2, 1, 0, 0, 1);
            // Assert.False(s.CanFinish(numCourses, prerequisites));

            // Test Case 38/46 (https://leetcode.com/submissions/detail/346404324)
            numCourses    = 3;
            prerequisites = Create2dArray(2, 1, 0, 0, 2, 2, 1);
            Assert.False(s.CanFinish(numCourses, prerequisites));
        }