Company: Principal Global_13thjuly

Difficulty: medium

Problem Statement

The input string will consist of only the characters '*', '#', 'C', and spaces. The input does not contain any leading, trailing, or consecutive spaces than the spaces explicitly shown between characters in the sample input). Input Format: A single line of input containing a string that represents the layout of the control center, cameras, and obstacles. The control center is denoted by 'C', cameras by '*', and obstacles by '#'. Spaces are used to represent empty spaces. Output Format: A single line of output should consist of an integer that represents the number of cameras that can connect to the control center without any obstruction in their direct line of sight. Sample Input 1: * C* * Sample Output 1: 3 Explanation 1: Here, three cameras can connect to the control center without any obstruction in their direct line of sight, which will be printed as output. Sample Input 2: * * C* * #* Sample Output 2: 4 Explanation 2: Here, four cameras can connect to the control center without an

More Principal Global_13thjuly OA questionsInterview experiences