Company: Juspay_29aug
Difficulty: medium
Parade in HackerLand Problem Description In HackerLand, people are preparing for a parade with a rule that no red uniform can be immediately to the left of a blue one. Given a binary string named color where: "0" represents a person in a red uniform "1" represents a person in a blue uniform The goal is to remove any occurrence of "01" in the string through a specific process: At each second, all substrings "01" in the string are simultaneously changed to "10". This process repeats until no "01" is present in the string. Calculate the number of seconds it takes for the process to stop. Complete the getSwapTime function in the editor with the following parameter(s): string color : a binary string that represents the uniform colors of people Returns int : the time to complete the process Examples Example 1: Input: color = "0101" Output: 2 Explanation: t = 0, s = "0101" . There are "01" substrings at index 0 and index 2. Simultaneously, "01" at index 0 becomes "10" and "01" at index 2 beco