Python Simple Solution

  • 0
    from random import choice
    class Solution(object):
        def __init__(self, nums):
            :type nums: List[int]
            :type numsSize: int
   = nums
        def pick(self, target):
            :type target: int
            :rtype: int
            ra = filter(lambda i:[i] ==  target, range(len(
            return choice(ra)
    # Your Solution object will be instantiated and called as such:
    # obj = Solution(nums)
    # param_1 = obj.pick(target)

Log in to reply

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.