Capgemini 2025-August | String Combinatorics & Substring Logic | On-campus
Capgemini · Question · Posted Jun 2026
Question 1: Number of Monotonous Substrings Problem Statement Given a string S, print the number of monotonous substrings of S. Since the answer may be too large, print the answer modulo 1e9 + 7. A string is considered monotonous if all the characters of the string are exactly the same. Input Format The first line of input will contain a single integer T, denoting the number of test cases. The first line of each test case contains an integer N ...
The full answer & interview discussion are available to premium members.
Log in Create a free account