top of page

Tcs Coding Questions 2021

for num in arr: complement = target_sum - num if complement in seen: count += 1 seen.add(num)

Given a string, check if it's a palindrome or not. Tcs Coding Questions 2021

for char in s: if char_count[char] == 1: return char for num in arr: complement = target_sum -

Example: Input - "aabbc", Output - "c"

Example: Input - 1 -> 2 -> 3 -> 4 -> 5, Output - 3 Output - 3

bottom of page