diff --git a/online_judges/maximizing_xor/maximizing_xor_challenge.ipynb b/online_judges/maximizing_xor/maximizing_xor_challenge.ipynb index 4ca9ced..86a6051 100644 --- a/online_judges/maximizing_xor/maximizing_xor_challenge.ipynb +++ b/online_judges/maximizing_xor/maximizing_xor_challenge.ipynb @@ -36,7 +36,6 @@ "source": [ "## Constraints\n", "\n", - "See the [HackerRank problem page](https://www.hackerrank.com/challenges/maximizing-xor)." ] }, @@ -105,10 +104,12 @@ " assert_equal(max_xor(10, 15), 7)\n", " print('Success: test_maximizing_xor')\n", "\n", + "\n", "def main():\n", " test = TestMaximingXor()\n", " test.test_maximizing_xor()\n", "\n", + "\n", "if __name__ == '__main__':\n", " main()" ] diff --git a/online_judges/maximizing_xor/maximizing_xor_solution.ipynb b/online_judges/maximizing_xor/maximizing_xor_solution.ipynb index ebb422a..22f791a 100644 --- a/online_judges/maximizing_xor/maximizing_xor_solution.ipynb +++ b/online_judges/maximizing_xor/maximizing_xor_solution.ipynb @@ -35,7 +35,6 @@ "source": [ "## Constraints\n", "\n", - "See the [HackerRank problem page](https://www.hackerrank.com/challenges/maximizing-xor)." ] }, @@ -124,10 +123,12 @@ " assert_equal(max_xor(10, 15), 7)\n", " print('Success: test_maximizing_xor')\n", "\n", + "\n", "def main():\n", " test = TestMaximingXor()\n", " test.test_maximizing_xor()\n", "\n", + "\n", "if __name__ == '__main__':\n", " main()" ] diff --git a/online_judges/maximizing_xor/test_maximizing_xor.py b/online_judges/maximizing_xor/test_maximizing_xor.py index 5be8601..c165070 100644 --- a/online_judges/maximizing_xor/test_maximizing_xor.py +++ b/online_judges/maximizing_xor/test_maximizing_xor.py @@ -7,9 +7,11 @@ class TestMaximingXor(object): assert_equal(max_xor(10, 15), 7) print('Success: test_maximizing_xor') + def main(): test = TestMaximingXor() test.test_maximizing_xor() + if __name__ == '__main__': main() \ No newline at end of file diff --git a/online_judges/utopian_tree/test_utopian_tree.py b/online_judges/utopian_tree/test_utopian_tree.py index 5d4d9f5..2af3cd2 100644 --- a/online_judges/utopian_tree/test_utopian_tree.py +++ b/online_judges/utopian_tree/test_utopian_tree.py @@ -9,9 +9,11 @@ class TestUtopianTree(object): assert_equal(calc_utopian_tree_height(4), 7) print('Success: test_utopian_tree') + def main(): test = TestUtopianTree() test.test_utopian_tree() + if __name__ == '__main__': main() \ No newline at end of file diff --git a/online_judges/utopian_tree/utopian_tree_challenge.ipynb b/online_judges/utopian_tree/utopian_tree_challenge.ipynb index 0f42186..5d3a39f 100644 --- a/online_judges/utopian_tree/utopian_tree_challenge.ipynb +++ b/online_judges/utopian_tree/utopian_tree_challenge.ipynb @@ -36,7 +36,6 @@ "source": [ "## Constraints\n", "\n", - "See the [HackerRank problem page](https://www.hackerrank.com/challenges/utopian-tree)." ] }, @@ -73,9 +72,6 @@ }, "outputs": [], "source": [ - "# cycles = 0, print 1: base case\n", - "# cycles = 1, print 2: i = 1: 1 * 2\n", - "# cycles = 4, print 7: i = 1: 1 * 2, i = 2: 2 + 1, i = 3: 3 * 2, i = 4: 6 + 1\n", "def calc_utopian_tree_height(cycles):\n", " # TODO: Implement me\n", " pass" @@ -110,10 +106,12 @@ " assert_equal(calc_utopian_tree_height(4), 7)\n", " print('Success: test_utopian_tree')\n", "\n", + "\n", "def main():\n", " test = TestUtopianTree()\n", " test.test_utopian_tree()\n", "\n", + "\n", "if __name__ == '__main__':\n", " main()" ] diff --git a/online_judges/utopian_tree/utopian_tree_solution.ipynb b/online_judges/utopian_tree/utopian_tree_solution.ipynb index fca76ab..1488814 100644 --- a/online_judges/utopian_tree/utopian_tree_solution.ipynb +++ b/online_judges/utopian_tree/utopian_tree_solution.ipynb @@ -35,7 +35,6 @@ "source": [ "## Constraints\n", "\n", - "See the [HackerRank problem page](https://www.hackerrank.com/challenges/utopian-tree)." ] }, @@ -80,9 +79,6 @@ }, "outputs": [], "source": [ - "# cycles = 0, print 1: base case\n", - "# cycles = 1, print 2: i = 1: 1 * 2\n", - "# cycles = 4, print 7: i = 1: 1 * 2, i = 2: 2 + 1, i = 3: 3 * 2, i = 4: 6 + 1\n", "def calc_utopian_tree_height(cycles):\n", " height = 1\n", " if cycles == 0:\n", @@ -131,10 +127,12 @@ " assert_equal(calc_utopian_tree_height(4), 7)\n", " print('Success: test_utopian_tree')\n", "\n", + "\n", "def main():\n", " test = TestUtopianTree()\n", " test.test_utopian_tree()\n", "\n", + "\n", "if __name__ == '__main__':\n", " main()" ]