Company: HashedIn_19sep
Difficulty: medium
Lexicographically Smallest Cleaned Message Problem Description In a secure communications system, each transmitted message is a string of symbols (lowercase English letters). Because of interference, extra symbols may be embedded in the received message. To improve clarity, exactly k symbols must be removed from the received message S , keeping the remaining symbols in their original order. In addition, regulatory guidelines require that no two adjacent symbols in the cleaned message are identical. Among all subsequences of S of length n - k (formed by removing exactly k characters) that have no two consecutive identical symbols, find the lexicographically smallest one. If no such cleaned message exists, report -1 . Complete the function solveProblem(S, k) , which returns the cleaned message, or the string -1 if none exists. Input Format Read from standard input. S k Line 1 contains the string S , the received message. Line 2 contains the integer k , the exact number of characters to r