Tcs Coding Questions 2021

def is_palindrome(s): return s == s[::-1]

while fast and fast.next: slow = slow.next fast = fast.next.next Tcs Coding Questions 2021

return slow.data

return count

print(count_pairs_with_sum([1, 2, 3, 4, 5], 7)) # Output: 2 def is_palindrome(s): return s == s[::-1] while fast