{"push_id":1345680439,"size":1,"distinct_size":1,"ref":"refs/heads/master","head":"cacf17bb92f1ab9bfac5717892b274e2009b303f","before":"ec58710c253a09e98be8bef46b24d892cf7eba51","commits":[{"sha":"cacf17bb92f1ab9bfac5717892b274e2009b303f","author":{"name":"Koala5S","email":"54b3ec896bcedaa570863808fbbf3571557e52b9@gmail.com"},"message":"Reservoir sampling.\n\nGiven an array of integers with possible duplicates, randomly output the index of a given target number. You can assume that the given target number must exist in the array.\r\nNote:\r\nThe array size can be very large. Solution that uses too much extra space will not pass the judge.\r\nExample:\r\nint[] nums = new int[] {1,2,3,3,3};\r\nSolution solution = new Solution(nums);\r\n// pick(3) should return either index 2, 3, or 4 randomly. Each index should have equal probability of returning.\r\nsolution.pick(3);\r\n// pick(1) should return 0. Since in the array only nums[0] is equal to 1.\r\nsolution.pick(1);","distinct":true,"url":"https://api.github.com/repos/Koala5S/hello-world/commits/cacf17bb92f1ab9bfac5717892b274e2009b303f"}]}
{"actor":{"display_login":"Koala5S"}}