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 shows one number on the machine's dashboard. The spins are recorded as an array history of n equal-length strings of digits. The length of each string is the number of wheels, and history[i] lists the digits shown on the dashboard in spin i . A wheel with s stops can show any digit d with d <= s . In a spin, the digits of history[i] may be shown by the wheels in any order: the j -th character of the string is not tied to the j -th wheel. (inferred - every worked example assigns digits to wheels regardless of their position in the string, e.g. the 6 of spin 246 and the 7 of spin 712 in Example 1.) A digit 0 can be shown by any wheel, so it never requires a stop. (inferred - stops are described as running from 1 to 9, while the input is allowed to contain the digit 0.) Determine the minimum number of stops on each wheel so