File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 44
55import com_github_leetcode .NestedInteger ;
66
7+ /*
8+ * // This is the interface that allows for creating nested lists.
9+ * // You should not implement it, or speculate about its implementation
10+ * public interface NestedInteger {
11+ * // Constructor initializes an empty nested list.
12+ * public NestedInteger();
13+ *
14+ * // Constructor initializes a single integer.
15+ * public NestedInteger(int value);
16+ *
17+ * // @return true if this NestedInteger holds a single integer, rather than a nested list.
18+ * public boolean isInteger();
19+ *
20+ * // @return the single integer that this NestedInteger holds, if it holds a single integer
21+ * // Return null if this NestedInteger holds a nested list
22+ * public Integer getInteger();
23+ *
24+ * // Set this NestedInteger to hold a single integer.
25+ * public void setInteger(int value);
26+ *
27+ * // Set this NestedInteger to hold a nested list and adds a nested integer to it.
28+ * public void add(NestedInteger ni);
29+ *
30+ * // @return the nested list that this NestedInteger holds, if it holds a nested list
31+ * // Return empty list if this NestedInteger holds a single integer
32+ * public List<NestedInteger> getList();
33+ * }
34+ */
735public class Solution {
836 private int i = 0 ;
937
Original file line number Diff line number Diff line change @@ -28,3 +28,8 @@ public int pick(int target) {
2828 return list .get (rand .nextInt (list .size ()));
2929 }
3030}
31+ /*
32+ * Your Solution object will be instantiated and called as such:
33+ * Solution obj = new Solution(nums);
34+ * int param_1 = obj.pick(target);
35+ */
You can’t perform that action at this time.
0 commit comments