847. Non-Allergic String
Bob is allergic to strings that contain adjacent characters of the same type, with a maximum of k repetitions. Given a string s and an integer k, a k-duplicate removal involves selecting k adjacent and identical letters from s and removing them, resulting in the concatenation of the remaining substrings on both sides of the deleted substring. This process is repeated until no further removals can be made. Print the final non-allergic string.
The first line contains a single integer k. The second line contains a string s.
Print the final non-allergic string.
1 <= N <= 10^4, 1 <= k <= N