File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
c-sharp/Problems/arrays-and-hashing Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2
2
* 1346
3
3
* Check If N and Its Double Exist
4
4
**
5
- * Given an array arr of integers, check if there exist two indices i and j such that:
5
+ * Given an array arr of integers,
6
+ * check if there exist two indices i and j such that:
6
7
* • i != j
7
8
* • 0 <= i, j < arr.length
8
9
* • arr[i] == 2 * arr[j]
28
29
* maintaining in a hashTable the array elements from [0, i - 1].
29
30
*
30
31
* Hint 2:
31
- * On each step of the loop check if we have seen the element 2 * arr[i] so far.
32
+ * On each step of the loop check
33
+ * if we have seen the element 2 * arr[i] so far.
32
34
*
33
35
* Hint 3:
34
- * Also check if we have seen arr[i] / 2 in case arr[i] % 2 == 0.
36
+ * Also check if we have seen
37
+ * arr[i] / 2 in case arr[i] % 2 == 0.
35
38
**
36
39
* https://leetcode.com/problems/check-if-n-and-its-double-exist/
37
40
***/
You can’t perform that action at this time.
0 commit comments