驱动网址导航     实用工具     AI智能工具
Tcs Coding Questions 2021

Tcs Coding Questions 2021 (2024)

def find_middle_element(head): slow = head fast = head

for char in s: if char_count[char] == 1: return char Tcs Coding Questions 2021

class Node: def __init__(self, data): self.data = data self.next = None def find_middle_element(head): slow = head fast = head

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

Given a string, check if it's a palindrome or not.

print(find_middle_element(head)) # Output: 3

Example: Input - "madam", Output - True

 
Tcs Coding Questions 2021
QQ在线咨询
客服QQ
158695710
客服邮箱
aww255@qq.com