Tcs Coding Questions 2021 -
Given a string, find the first non-repeating character in it.
while fast and fast.next: slow = slow.next fast = fast.next.next Tcs Coding Questions 2021
for char in s: if char_count[char] == 1: return char Given a string, find the first non-repeating character in it
return max_sum
Given a string, check if it's a palindrome or not. Given a string
return slow.data
print(count_pairs_with_sum([1, 2, 3, 4, 5], 7)) # Output: 2