2021 Fixed - Tcs Coding Questions

1 ≤ length of string ≤ 10⁵

First line: N Second line: N integers Third line: M Tcs Coding Questions 2021

num = int(input()) b, c = decimal_to_binary(num) print(b) print(c) 1 ≤ length of string ≤ 10⁵ First

def reverse_string(s): letters = [ch for ch in s if ch.isalpha()] letters.reverse() result = [] idx = 0 for ch in s: if ch.isalpha(): result.append(letters[idx]) idx += 1 else: result.append(ch) return ''.join(result) Tcs Coding Questions 2021

To avoid disqualification or zero marks, candidates had to follow these strict I/O rules provided by Scribd :