while fast and fast.next: slow = slow.next fast = fast.next.next
return max_sum
for char in s: if char_count[char] == 1: return char
Given a linked list, find the middle element.
class Node: def __init__(self, data): self.data = data self.next = None
def is_palindrome(s): return s == s[::-1]
return count
No account yet?
Create an Account