How to include the Constraints

If you are asking on how to include these constrains in your code, then let me tell you that constrains are more like tips here, they tell you how big values might be and so that you can adjust your data types to hold those values ( like you need to use long for large numbers and long long for even larger numbers like for example, for 1 ≤ T ≤ 10^13, you will need long long int, a simple int will not be enough ). You don’t need to check for those constrains in your code, the values will always be within the constrains.

Let us consider your case

1 ≤ T ≤ 7

It means that the value for T entered during your program run on codechef will be >= 1 and <= 7.

And

1 ≤ |S| ≤ 10^5

Probably means that the length of S will be >= 1 and <= 10^5.

Hope this is what you were asking for in your question. :slight_smile:

8 Likes