Company: ibm_29sep
Difficulty: medium
Get Smallest String Problem Description You are given a binary string dataSequence and an integer maxSwaps . The adjacent characters in the string can be swapped at most maxSwaps times. Your task is to determine the alphabetically smallest string that can be achieved by performing at most maxSwaps swaps. Note: A string is said to be alphabetically smaller than another if it appears before it in dictionary order, comparing character by character from left to right. Function Description Complete the function getSmallestString in the editor with the following parameters: string dataSequence : the binary string int maxSwaps : the maximum number of adjacent swaps that can be performed Returns string : the alphabetically smallest binary string after at most maxSwaps swaps. Examples Example 1: Input: dataSequence = "1111100", maxSwaps = 5 Output: "0111110" Explanation: To achieve the alphabetically smallest string, we prioritize moving '0's to the leftmost possible positions. The following se