Run-length encoding replaces each run of a repeated character by the character followed by its count (a count of 1 is omitted). Given a string s and an integer k, delete at most k characters to minimize the length of the run-length encoding of the remaining string. Return that minimum length. The input is JSON {s, k}.
Input: JSON {s, k}.
Output: Integer — the minimum encoded length.
Input: {"s":"aaabcccd","k":2}
Output: 4
Explanation: Delete b and d to get 'a3c3'.Input: {"s":"aabbaa","k":2}
Output: 2
Explanation: Delete both b's to get 'a4'.Input: {"s":"aaaaaaaaaaa","k":0}
Output: 3
Explanation: 'a11' has length 3.1<=|s|<=1000<=k<=|s|