Weighted Raffle with Repeat Penalties
Problem statement
Participant i entered entryCounts[i] times and receives total raffle weight 1 / entryCounts[i]. Normalize all weights into probabilities.
Return each probability in input order as a reduced numerator/denominator string.
Function
raffleProbabilities(entryCounts: int[]) → String[]Examples
Example 1
entryCounts = [2,3,1]return = ["3/11","2/11","6/11"]Weights 1/2, 1/3, and 1 normalize against total 11/6.
Constraints
1 <= entryCounts.length <= 12.1 <= entryCounts[i] <= 30.- The least common multiple fits in signed 64-bit range.