Company: Gep_worldwide
Difficulty: medium
Game of String Distribution Problem Description Joe has organized a party for M guests and has planned a party game. In the game, Joe gives everyone a string S and explains to them the rules to play the game. The rules to play the game are as follows: - You need to distribute the string S amongst M guests in such a way that each guest gets at least one character. - Compare all the strings and store the smallest lexicographical string among that distribution. - Out of all the stored strings, find the largest lexicographical string which is the strongest string. Your task is to find and return the strongest string among all smallest lexicographical strings that are stored for every distribution. Note: The lexicographical order is the order in which the words appear in the dictionary. Examples Example 1: Input: input1: 3 input2: good Output: gd Explanation: Here the given string S = "good" and the number of guests are 3. Here are all possible ways in which you can distribute the string am