Company: Zenoti_28nov
Difficulty: medium
String Game Problem Description You are given a number $N$ and an integer $K$. Your task is to find the maximum number that can be formed if you insert exactly $K$ commas between the digits of $N$ to divide it into different numbers. For example, Consider $N = 455$ and $k = 1$. You must determine the maximum number that can be formed if you insert exactly $K$ commas between the digits of $N$ to divide it into different numbers. $N$ can be divided into $4, 55$ by using 1 comma. Therefore the answer is 55. Function description: Complete the StringGame function provided in the editor. This function takes the following 2 parameters and returns the maximum number that can be formed if you insert exactly $K$ commas between the digits of $N$ to divide it into different numbers. $K$: Represents the number of commas $S$: Represents the number $N$ (as a string) Examples Example 1: Input: K = 1 N = 999 Output: 99 Explanation: For the 1st testcase, inserting one comma will lead to maximum number 9