Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
17\. Letter Combinations of a Phone Number

Medium

Given a string containing digits from `2-9` inclusive, return all possible letter combinations that the number could represent. Return the answer in **any order**.

A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.

![](https://upload.wikimedia.org/wikipedia/commons/thumb/7/73/Telephone-keypad2.svg/200px-Telephone-keypad2.svg.png)

**Example 1:**

**Input:** digits = "23"

**Output:** \["ad","ae","af","bd","be","bf","cd","ce","cf"\]

**Example 2:**

**Input:** digits = ""

**Output:** \[\]

**Example 3:**

**Input:** digits = "2"

**Output:** \["a","b","c"\]

**Constraints:**

* `0 <= digits.length <= 4`
* `digits[i]` is a digit in the range `['2', '9']`.
29 changes: 29 additions & 0 deletions src/main/java/g0001_0100/s0018_four_sum/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
18\. 4Sum

Medium

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:

* `0 <= a, b, c, d < n`
* `a`, `b`, `c`, and `d` are **distinct**.
* `nums[a] + nums[b] + nums[c] + nums[d] == target`

You may return the answer in **any order**.

**Example 1:**

**Input:** nums = \[1,0,-1,0,-2,2\], target = 0

**Output:** \[\[-2,-1,1,2\],\[-2,0,0,2\],\[-1,0,0,1\]\]

**Example 2:**

**Input:** nums = \[2,2,2,2,2\], target = 8

**Output:** \[\[2,2,2,2\]\]

**Constraints:**

* `1 <= nums.length <= 200`
* `-109 <= nums[i] <= 109`
* `-109 <= target <= 109`
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
19\. Remove Nth Node From End of List

Medium

Given the `head` of a linked list, remove the `nth` node from the end of the list and return its head.

**Example 1:**

![](https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg)

**Input:** head = \[1,2,3,4,5\], n = 2

**Output:** \[1,2,3,5\]

**Example 2:**

**Input:** head = \[1\], n = 1

**Output:** \[\]

**Example 3:**

**Input:** head = \[1,2\], n = 1

**Output:** \[1\]

**Constraints:**

* The number of nodes in the list is `sz`.
* `1 <= sz <= 30`
* `0 <= Node.val <= 100`
* `1 <= n <= sz`

**Follow up:** Could you do this in one pass?