Skip to content

Commit d37bd6e

Browse files
miguelHxlhchavez
andauthored
Update Python/chapter02/2.6 - Palindrome/miguel_2.6_soln.py
commit suggestion Co-Authored-By: lhchavez <[email protected]>
1 parent 17cb5a7 commit d37bd6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/chapter02/2.6 - Palindrome/miguel_2.6_soln.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def is_palindrome_constant_space(ll: LinkedList) -> bool:
167167
temp_ll1 = LinkedList()
168168
temp_ll2 = LinkedList()
169169
n = ll.head
170-
for _ in range(math.ceil(ll.size/2)):
170+
for _ in range((ll.size + 1) // 2):
171171
temp_ll1.append_to_tail(n) # first half
172172
n = n.next
173173
while n is not None:

0 commit comments

Comments
 (0)