#https://leetcode.com/explore/challenge/card/june-leetcoding-challenge/539/week-1-june-1st-june-7th/3351/

class Solution:

    def __init__(self, w: List[int]):
        self.weights = w
        self.indices = list(range(0,len(w)))

    def pickIndex(self) -> int:
        return random.choices(self.indices,weights=self.weights,k=1)[0]
        


# Your Solution object will be instantiated and called as such:
# obj = Solution(w)
# param_1 = obj.pickIndex()
e0ef247bc0104d7dbb658c79dce1292f6fc36e74
<mask token>

class Solution:
    <mask token>
    <mask token>

class Solution:

    def __init__(self, w: List[int]):
        self.weights = w
        self.indices = list(range(0, len(w)))
    <mask token>

class Solution:

    def __init__(self, w: List[int]):
        self.weights = w
        self.indices = list(range(0, len(w)))

    def pickIndex(self) ->int:
        return random.choices(self.indices, weights=self.weights, k=1)[0]

#https://leetcode.com/explore/challenge/card/june-leetcoding-challenge/539/week-1-june-1st-june-7th/3351/

class Solution:

    def __init__(self, w: List[int]):
        self.weights = w
        self.indices = list(range(0,len(w)))

    def pickIndex(self) -> int:
        return random.choices(self.indices,weights=self.weights,k=1)[0]
        


# Your Solution object will be instantiated and called as such:
# obj = Solution(w)
# param_1 = obj.pickIndex()