Tcs Coding Questions 2021 [repack] ✦
return count
def first_non_repeating_char(s): char_count = {} for char in s: if char in char_count: char_count[char] += 1 else: char_count[char] = 1
Example: Input - [-2, 1, -3, 4, -1, 2, 1, -5, 4], Output - 6 Tcs Coding Questions 2021
print(max_subarray_sum([-2, 1, -3, 4, -1, 2, 1, -5, 4])) # Output: 6
Here are some TCS coding questions from 2021, along with a useful piece of code for each: Output - 6 print(max_subarray_sum([-2
for num in arr: complement = target_sum - num if complement in seen: count += 1 seen.add(num)
print(find_middle_element(head)) # Output: 3 Tcs Coding Questions 2021
for char in s: if char_count[char] == 1: return char