Skip to content

Commit afffce8

Browse files
Updated 0018 - 4Sum.md ad per requested
Updated 0018 - 4Sum.md ad per requested
1 parent 38a445e commit afffce8

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

dsa-solutions/lc-solutions/0000-0099/0018-4Sum.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,7 @@ tags:
66
- Arrays
77
- Hashing
88
- Two Pointers
9-
description: Given an array `nums` of `n` integers, return an array of all the unique quadruplets `[nums[a], nums[b], nums[c], nums[d]]` such that:
10-
11-
- `0 <= a, b, c, d < n`
12-
- `a, b, c, and d are distinct`
13-
- `nums[a] + nums[b] + nums[c] + nums[d] == target`
9+
description: Given an array `nums` of `n` integers, return an array of all the unique quadruplets `[nums[a], nums[b], nums[c], nums[d]]`
1410

1511
---
1612

@@ -45,9 +41,9 @@ Write a function that finds all unique quadruplets in the array which gives the
4541
- **Output:** `[2,2,2,2]`
4642

4743
## Constraints
48-
- `1 <= nums.length <= 200`
49-
- `-10^9 <= nums[i] <= 10^9`
50-
- `-10^9 <= target <= 10^9`
44+
- $1 \leq \text{nums.length} \leq 200$
45+
- $-10^9 \leq \text{nums}[i] \leq 10^9$
46+
- $-10^9 \leq \text{target} \leq 10^9$
5147

5248
## Approach
5349
1. **Sorting**: Start by sorting the array `nums`. This helps in avoiding duplicates and simplifies the two-pointer approach.

0 commit comments

Comments
 (0)