Example #1
0
        public void KeysAndRoomsTest()
        {
            var keys = new List <IList <int> >();

            keys.Add(new List <int>()
            {
                1, 3
            });
            keys.Add(new List <int>()
            {
                3, 2, 1
            });
            keys.Add(new List <int>()
            {
                2
            });
            keys.Add(new List <int>()
            {
            });
            var testObj = new KeysAndRooms.Solution();

            Assert.IsTrue(testObj.CanVisitAllRooms(keys));
        }
Example #2
0
        static void KeysAndRooms()
        {
            Console.WriteLine("841. Keys And Rooms");
            var keys = new List <IList <int> >();

            keys.Add(new List <int>()
            {
                1, 3
            });
            keys.Add(new List <int>()
            {
                3, 2, 1
            });
            keys.Add(new List <int>()
            {
                2
            });
            keys.Add(new List <int>()
            {
            });
            var testObj = new KeysAndRooms.Solution();

            Console.WriteLine(testObj.CanVisitAllRooms(keys));
        }