We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3257c2b commit 9ca0308Copy full SHA for 9ca0308
MEDIUM/src/medium/LinkedListRandomNode.java
@@ -28,9 +28,7 @@
28
*/
29
public class LinkedListRandomNode {
30
31
-}
32
-
33
-class Solution {
+private class Solution {
34
private Map<Integer, ListNode> map;
35
private Random rand;
36
@@ -50,4 +48,5 @@ public int getRandom() {
50
48
return map.get(rand.nextInt(map.size())).val;
51
49
}
52
+}
53
MEDIUM/src/medium/RandomPickIndex.java
@@ -38,7 +38,7 @@ class Solution_MemoryLimitExceeded {
38
private Map<Integer, List<Integer>> map = new HashMap();
39
java.util.Random rand = new java.util.Random();
40
41
- public Solution_MLE(int[] nums) {
+ public Solution_MemoryLimitExceeded(int[] nums) {
42
for(int i = 0; i < nums.length; i++){
43
if(map.containsKey(nums[i])){
44
List<Integer> list = map.get(nums[i]);
0 commit comments