Exemplo n.º 1
0
        public override string SecondStar()
        {
            var input  = ReadLineInput();
            var result = Towers.FindUnbalanced(input);

            return(result.ToString());
        }
Exemplo n.º 2
0
        public override string FirstStar()
        {
            var input  = ReadLineInput();
            var result = Towers.BottomDisc(input).Name;

            return(result);
        }
Exemplo n.º 3
0
        public void FirstStarExample()
        {
            var input = new[] {
                "pbga (66)                    ",
                "xhth (57)                    ",
                "ebii (61)                    ",
                "havc (66)                    ",
                "ktlj (57)                    ",
                "fwft (72) -> ktlj, cntj, xhth",
                "qoyq (66)                    ",
                "padx (45) -> pbga, havc, qoyq",
                "tknk (41) -> ugml, padx, fwft",
                "jptl (61)                    ",
                "ugml (68) -> gyxo, ebii, jptl",
                "gyxo (61)                    ",
                "cntj (57)                    "
            };
            var bottom = Towers.BottomDisc(input);

            Assert.Equal("tknk", bottom.Name);
        }
Exemplo n.º 4
0
        public void SecondStarExample()
        {
            var input = new[] {
                "pbga (66)                    ",
                "xhth (57)                    ",
                "ebii (61)                    ",
                "havc (66)                    ",
                "ktlj (57)                    ",
                "fwft (72) -> ktlj, cntj, xhth",
                "qoyq (66)                    ",
                "padx (45) -> pbga, havc, qoyq",
                "tknk (41) -> ugml, padx, fwft",
                "jptl (61)                    ",
                "ugml (68) -> gyxo, ebii, jptl",
                "gyxo (61)                    ",
                "cntj (57)                    "
            };
            var unbalanced = Towers.FindUnbalanced(input);

            Assert.Equal(60, unbalanced);
        }