Lexicographically largest string possible consisting of at most K consecutive similar characters
Given a string S and an integer K, the task is to generate lexicographically the largest string possible from the given string, by removing characters also, that consist of at most K consecutive similar characters. Examples: Input: S = âbacccâ, K = 2Output: ccbca Input: S = âccbbbâ, K = 2Output: ccb