Tcs Coding Questions 2021 (Legit ✭)
class Node: def __init__(self, data): self.data = data self.next = None
def is_palindrome(s): return s == s[::-1] Tcs Coding Questions 2021
for num in arr: current_sum = max(num, current_sum + num) max_sum = max(max_sum, current_sum) class Node: def __init__(self, data): self
Here are some TCS coding questions from 2021, along with a useful piece of code for each: class Node: def __init__(self
while fast and fast.next: slow = slow.next fast = fast.next.next
for num in arr: complement = target_sum - num if complement in seen: count += 1 seen.add(num)
Example: Input - "madam", Output - True