Company: Morgan stanley_17july
Difficulty: medium
Slot Machine 2.0 Problem Description A slot machine has multiple wheels that are spun n times. In each spin, each wheel may have multiple stops from 1 to 9 and show one random number on the machine's dashboard. Given the number of spins n, determine the minimum number of stops on each wheel to produce the numbers displayed on the dashboard for each spin. Then, calculate the total stops. Complete the function slotSpins in the editor below. slotWheels has the following parameter(s): string history[n] : equal-length strings of digits spun Returns: int : the sum of the minimum number of stops on all of the wheels. Examples Example 1: Input: n = 4 history = ['712', '246', '365', '312'] Output: 15 Explanation: The spins on a slot machine with 3 wheels are recorded as an array, history. 7 1 2 2 4 6 3 6 5 3 1 2 One wheel needs to have at least 7 stops to produce the numbers displayed on the dashboard for 1st spin. Remove the highest value from each of the rows. 1 2 2 4 3 5 1 2 Now the highest