## Hypercube's LeetCode Weekly Contest 45

- Rank:
**22**/ 2292 - Score: 26 / 26
- Finish Time: 00:51:46

### Judge Route Circle

Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to **the original place**.

The move sequence is represented by a string. And each move is represent by a character. The valid robot moves are `R`

(Right), `L`

(Left), `U`

(Up) and `D`

(down). The output should be true or false representing whether the robot makes a circle.

**Example 1:**

```
Input: "UD"
Output: true
```

**Example 2:**

```
Input: "LL"
Output: false
```

**Accepted**in 00:07:25 with 1 wrong submissions

### Find K Closest Elements

Given a sorted array, two integers `k`

and `x`

, find the `k`

closest elements to `x`

in the array. The result should also be sorted in ascending order. If there is a tie, the smaller elements are always preferred.

**Example 1:**

```
Input: [1, 2, 3, 4, 5], k=4, x=3
Output: [1, 2, 3, 4]
```

**Example 2:**

```
Input: [1, 2, 3, 4, 5], k=4, x=-1
Output: [1, 2, 3, 4]
```

**Note:**

- The value k is positive and will always be smaller than the length of the sorted array.
- Length of the given array is positive and will not exceed 10^4
- Absolute value of elements in the array and x will not exceed 10^4

**Accepted**in 00:18:26

### Split Array into Consecutive Subsequences

You are given an integer array sorted in ascending order (may contain duplicates), you need to split them into several subsequences, where each subsequences consist of at least 3 consecutive integers. Return whether you can make such a split.

**Example 1:**

```
Input: [1, 2, 3, 3, 4, 5]
Output: True
Explanation:
You can split them into two consecutive subsequences:
1, 2, 3
3, 4, 5
```

**Example 2:**

```
Input: [1, 2, 3, 3, 4, 4, 5, 5]
Output: True
Explanation:
You can split them into two consecutive subsequences:
1, 2, 3, 4, 5
3, 4, 5
```

**Example 3:**

```
Input: [1, 2, 3, 4, 4, 5]
Output: False
```

**Note:**

- The length of the input is in range of [1, 10000]

**Accepted**in 00:41:46 with 1 wrong submissions

### Remove 9

Start from integer 1, remove any integer that contains 9 such as 9, 19, 29…

So now, you will have a new integer sequence: 1, 2, 3, 4, 5, 6, 7, 8, 10, 11, …

Given a positive integer `n`

, you need to return the n-th integer after removing. Note that 1 will be the first integer.

**Example 1:**

```
Input: 9
Output: 10
```

**Hint:** n will not exceed `9 x 10^8`

.

**Accepted**in 00:29:18