Company: MediBuddy_8oct
Difficulty: medium
First Word Problem Description You are playing a word game called "First Word" with your family. Each player receives a string S of length N. The goal of the game is to minimize your score by rearranging the string. The rearrangement is done using the following operation, which you may apply any number of times: From the first K characters of the string, choose one letter, remove it from its position, and append it to the end of the string. After rearranging the String S, you need to calculate the points using the following formula: Points = Σ i=0 N-1 Position(S[i]) * (N - i) - 1 (indexing starts from 0) Where Position[x] is the index of S in English alphabets (a=1, b=2, c=3, ..., y=25, z=26). It is not necessary to rearrange the string S if you are getting the minimum points using the current sequence of S. You can perform the above operation any number of times. Return the minimum number of points you can get after rearranging the given string S. Function Description Complete the sol