We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d0b126f commit 95a44e4Copy full SHA for 95a44e4
EASY/src/easy/TwoSumIIIDataStructureDesign.java
@@ -0,0 +1,22 @@
1
+package easy;
2
+
3
+import java.util.HashSet;
4
+import java.util.Set;
5
6
+//Your TwoSum object will be instantiated and called as such:
7
+//TwoSum twoSum = new TwoSum();
8
+//twoSum.add(number);
9
+//twoSum.find(value);
10
+public class TwoSumIIIDataStructureDesign {
11
+ private Set<Integer> set = new HashSet();
12
13
+ // Add the number to an internal data structure.
14
+ public void add(int number) {
15
+ set.add(number);
16
+ }
17
18
+ // Find if there exists any pair of numbers which sum is equal to the value.
19
+ public boolean find(int value) {
20
+ return
21
22
+}
0 commit comments