Company: JPMC_28june
Difficulty: medium
Remove AWS Occurrences Problem Description Given a string s with uppercase English letters, remove all occurrences of the string "AWS" until no more remain. After each removal, the prefix and suffix strings are concatenated. Return the final string. If the final string is empty, return "-1" as a string. Complete the function getFinalString in the editor below. The function getFinalString has the following parameter: string s : a string of uppercase English characters. Returns: string : the string after removing all occurrences of "AWS" from the given string or "-1". Examples Example 1: Input: s = "AWAWSSG" Output: "G" Explanation: Initially, s = "AWAWSSG" . 1. Remove the first occurrence of "AWS" from "AWAWSSG". The string becomes "AWSG". 2. Remove the occurrence of "AWS" from "AWSG". The string becomes "G". No more "AWS" occurrences are found. The final string is "G". Example 2: Input: s = "AAWSWS" Output: "-1" Explanation: Initially, s = "AAWSWS" . 1. Remove the first occurrence of "