Tcs Coding Questions 2021 (2024)
def find_middle_element(head): slow = head fast = head
for char in s: if char_count[char] == 1: return char Tcs Coding Questions 2021
class Node: def __init__(self, data): self.data = data self.next = None def find_middle_element(head): slow = head fast = head
for num in arr: complement = target_sum - num if complement in seen: count += 1 seen.add(num) Output - True
Given a string, check if it's a palindrome or not.
print(find_middle_element(head)) # Output: 3
Example: Input - "madam", Output - True


