Tcs Coding Questions 2021
Example: Input - "madam", Output - True
for char in s: if char_count[char] == 1: return char Tcs Coding Questions 2021
return count
def count_pairs_with_sum(arr, target_sum): count = 0 seen = set() Example: Input - "madam", Output - True for
def max_subarray_sum(arr): max_sum = float('-inf') current_sum = 0 Example: Input - "madam"
while fast and fast.next: slow = slow.next fast = fast.next.next