Company: Cognizant_15_dec
Difficulty: medium
Minimum Removals to Eliminate "ppp" Substring Alice is working on a system that processes text inputs from users. One of the requirements is that the text must not contain the substring "ppp" - three consecutive 'p' characters. If this substring appears, the text is rejected. To make the input text acceptable, Alice needs to remove characters in such a way that the substring "ppp" does not exist. Your task is to help Alice find and return an integer value representing the minimum number of characters that need to be removed from the text to meet this requirement. Example 1: Input: s = "pppiii" Output: 1 Explanation: The input string "pppiii" contains one instance of "ppp". By removing one 'p' (e.g., the first one), the string becomes "ppiii", which no longer contains the forbidden substring. Therefore, the minimum number of removals is 1. Example 2: Input: s = "pppp" Output: 2 Explanation: The input string "pppp" contains two overlapping instances of the forbidden substring: one starti