Company: Amazon_29may
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 'slotwheels' function below. * * The function is expected to return an INTEGER. * The function accepts STRING_ARRAY history as parameter. */ public static int slotwheels(List<String> history) { // Function body would go here } Examples Example 1: Input: n = 4 history = ['137', '364', '115', '724'] Output: 14 Explanation: The spins on a slot machine with 4 wheels are recorded as an array history. 1 3 7 3 6 4 1 1 5 7 2 4 One wheel needs to have at least 7 stops to produce the numbers displayed on the dashboard for 1st spin and 4th spin. Remove the highest value from each of the row