1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* An IntBag represents a multiset of integers between min and max.
* That is, each number between min and max can occur some non-negative
* number of times in a particular IntBag.
*/
public class IntBag {
// constructors in java are like __init__ in python
public IntBag(int min, int max) {
}
/**
* Adds one instance of value to this IntBag.
* @param value the value to be added
*/
public void add(int value) {
}
/**
* Returns true when the bag has no instances of any elements
* and false otherwise.
* @return true iff the bag is empty
*/
public boolean isEmpty() {
return false;
}
/**
* Chooses (but does not remove) a uniformly random element from this
* IntBag in proportion to how many elements exist for each number.
* @return the element picked from the bag
*/
public int pick() {
return -1;
}
}