diff --git a/linked_lists/palindrome/palindrome_solution.ipynb b/linked_lists/palindrome/palindrome_solution.ipynb index 93b53a3..199809b 100644 --- a/linked_lists/palindrome/palindrome_solution.ipynb +++ b/linked_lists/palindrome/palindrome_solution.ipynb @@ -33,7 +33,6 @@ "source": [ "## Constraints\n", "\n", - "* Is a single character or number a palindrome?\n", " * No\n", "* Can we assume we already have a linked list class that can be used for this problem?\n", @@ -100,6 +99,9 @@ }, "outputs": [], "source": [ + "from __future__ import division\n", + "\n", + "\n", "class MyLinkedList(LinkedList):\n", " \n", " def is_palindrome(self):\n", @@ -117,7 +119,7 @@ " \n", " # Compare the reversed list with the original list\n", " # Only need to compare the first half \n", - " iterations_to_compare_half = length / 2\n", + " iterations_to_compare_half = length // 2\n", " curr = self.head\n", " curr_reversed = reversed_list.head\n", " for _ in range(0, iterations_to_compare_half):\n",