Output Format: A positive integer representing the highest frequency of any character in the string.
M=13. Standard greedy: 10+3 = 2 coins. But remainder after 10 =3 (divisible by 3) → forbidden. So you must choose 5+5+3 =3 coins.
s = input() print(reverse_string(s))
), write a program to find how many two-wheelers and four-wheelers were manufactured. Mathematical Derivation: be the number of two-wheelers and be the number of four-wheelers. Substituting Tcs Coding Questions 2021
The majority of the coding problems fell into four major categories:
Question 3: Vehicle Production System (Linear Equations / Mathematics)
To tailor this preparation guide to your current focus, tell me: What do you plan to use for your exam? Are you aiming for the Ninja or the Digital role track? Share public link Output Format: A positive integer representing the highest
High-level "Digital" roles often feature string manipulation or number theory. Problem Statement:
| 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 |
private static boolean isPalindrome(String s, int left, int right) while (left < right) if (s.charAt(left) != s.charAt(right)) return false; left++; right--; But remainder after 10 =3 (divisible by 3) → forbidden
Traverse the string sequentially, incrementing a counter variable when a * is encountered and decrementing it when a # is encountered. C++ Implementation
Do not just memorize the code. Understand the why behind the logic. TCS is looking for engineers who can debug and adapt. Take the six questions listed above, write them from scratch three times each, and you will be more prepared than 90% of candidates who sat for the 2021 exam.
Example: