Tcs Coding Questions 2021 //top\\ 〈EXTENDED · METHOD〉
One easy problem, one medium/hard problem 0.5.4. Languages: C, C++, Java, Python, or Perl. 2. Top Topics for TCS Coding Questions 2021
Usually a generous time limit (e.g., 90 minutes) for 2 questions 0.5.4 . Tcs Coding Questions 2021
Logical printing of stars, numbers, or alphabets in a specific structure. 3. Sample TCS 2021 Coding Problems & Solutions One easy problem, one medium/hard problem 0
An analysis of the 2021 papers reveals that TCS examiners heavily favored specific categories of problems: Top Topics for TCS Coding Questions 2021 Usually
Given a number N , write a program to obtain a number M by reversing the digits of N . If M contains trailing zeros, they must be removed (which happens naturally during integer reversal).
def solve(): N = 10 # Total Capacity M = 10 # Currently available k = 5 # Minimum required order = int(input()) if order > N or order <= 0: print("INVALID INPUT") print(f"NUMBER OF CANDIES AVAILABLE: M") else: M = M - order print(f"NUMBER OF CANDIES SOLD: order") print(f"NUMBER OF CANDIES AVAILABLE: M") # solve() Use code with caution. Example 2: Toggle Bits after MSB (12th Sept 2021)
#include #include using namespace std; int main() string s; if (!(cin >> s)) return 0; int balance = 0; for (char c : s) if (c == '*') balance++; else if (c == '#') balance--; cout << balance << endl; return 0; Use code with caution. 4. Custom Matrix Rotation / Grid Traversal Problem Statement