Ejemplo n.º 1
0
        public void TestMethod2()
        {
            //[4,1,null,2,null,3]
            var Input = new TreeNode(4)
            {
                left = new TreeNode(1)
                {
                    left = new TreeNode(2)
                    {
                        left = new TreeNode(3)
                    }
                }
            };
            var Expected = 7;
            var Actual   = HouseRobberIII_337.Rob(Input);

            Assert.AreEqual(Expected, Actual);
        }
Ejemplo n.º 2
0
        public void TestMethod1()
        {
            var Input = new TreeNode(3)
            {
                left = new TreeNode(2)
                {
                    right = new TreeNode(3)
                },
                right = new TreeNode(3)
                {
                    right = new TreeNode(1)
                }
            };
            var Expected = 7;
            var Actual   = HouseRobberIII_337.Rob(Input);

            Assert.AreEqual(Expected, Actual);
        }