TITAT - editorial

PROBLEM LINK:

Practice
Contest

TIT FOR TAT

Problem Code: TITAT

Difficulty: Cakewalk

The problem follows a simple logic wherein we just need to count the number of capital letters to find out the number of words in the message.

The important point that needs to be noted here is that the constraint for the number of characters is 200. If one uses a character array then the size of the character array needs to be at least 201 since we need an extra space for storing “/0”. The best approach would be to use a string datatype in C++ wherein one need not have to necessarily specify the size of the string.

The below code is the most basic and simplest implementation of the given problem.

Time complexity = O(n)

Setter Solution : Solution