MCPcopy Create free account
hub / github.com/VanjaRo/LeetCode / GetRandom

Method GetRandom

tasks/380.go:51–53  ·  view source on GitHub ↗

** Get a random element from the set. */

()

Source from the content-addressed store, hash-verified

49
50/** Get a random element from the set. */
51func (this *RandomizedSet) GetRandom() int {
52 return this.vals[rand.Intn(len(this.vals))]
53}
54
55/**
56 * Your RandomizedSet object will be instantiated and called as such:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected