Problem Description
Given a string A and integer B, remove all consecutive same characters that have length exactly B.
NOTE : All the consecutive same characters that have length exactly B will be removed simultaneously.
1 <= |A| <= 100000
1 <= B <= |A|
First Argument is string A.
Second argument is integer B.
Return a string after doing the removals.
Input 1:
A = "aabcd" B = 2
Input 2:
A = "aabbccd" B = 2
Output 1:
"bcd"
Output 2:
"d"
Explanation 1:
"aa" had length 2.
Explanation 2:
"aa", "bb" and "cc" had length of 2.
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a question? Checkout Sample Codes for more details.