Tcs Coding Questions 2021 'link' -
Dynamic Programming: Basic optimization problems and pathfinding. Conditionals: Nested logic and coordinate geometry. Solved Examples from TCS 2021 Slots 1. The Keyword "Sweet Number" (Array/Math)
def remove_consecutive_duplicates(s): result = [] for ch in s: if not result or ch != result[-1]: result.append(ch) return ''.join(result) Tcs Coding Questions 2021
if(dist <= 5) fare = 100; else if(dist <= 15) fare = 100 + (dist - 5) * 10; else fare = 100 + 100 + (dist - 15) * 8; = 5) fare = 100
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 else if(dist <
| Component | Details | |-----------|---------| | | 1 or 2 coding problems | | Time Allotted | 15–20 minutes (for coding) | | Languages Allowed | C, C++, Java, Python, Perl | | Difficulty | Easy to Medium | | Topics Covered | Arrays, Strings, Loops, Conditionals, Basic Math, Recursion |