## Hypercube's LeetCode Weekly Contest 49

- Rank:
**731**/ 2362 - Score: 9 / 27
- Finish Time: 00:26:39

### Longest Continuous Increasing Subsequence

Given an unsorted array of integers, find the length of longest `continuous`

increasing subsequence.

**Example 1:**

```
Input: [1, 3, 5, 4, 7]
Output: 3
Explanation: The longest continuous increasing subsequence is [1, 3, 5], its length is 3.
Even though [1, 3, 5, 7] is also an increasing subsequence, it's not a continuous one where 5 and 7 are separated by 4.
```

**Example 2:**

```
Input: [2, 2, 2, 2, 2]
Output: 1
Explanation: The longest continuous increasing subsequence is [2], its length is 1.
```

**Note:** Length of the array will not exceed 10,000.

**Accepted**in 00:06:40 with 1 wrong submissions

### Implement Magic Dictionary

Implement a magic directory with `buildDict`

, and `search`

methods.

For the method `buildDict`

, you’ll be given a list of non-repetitive words to build a dictionary.

For the method `search`

, you’ll be given a word, and judge whether if you modify **exactly** one character into **another** character in this word, the modified word is in the dictionary you just built.

**Example 1:**

```
Input: buildDict(["hello", "leetcode"]), Output: Null
Input: search("hello"), Output: False
Input: search("hhllo"), Output: True
Input: search("hell"), Output: False
Input: search("leetcoded"), Output: False
```

**Note:**

- You may assume that all the inputs are consist of lowercase letters
`a-z`

. - For contest purpose, the test data is rather small by now. You could think about highly efficient algorithm after the contest.
- Please remember to
**RESET**your class variables declared in class MagicDictionary, as static/class variables are**persisted across multiple test cases**. Please see here for more details.

**Accepted**in 00:16:39 with 1 wrong submissions

### Cut Off Trees for Golf Event

You are asked to cut off trees in a forest for a golf event. The forest is represented as a non-negative 2D map, in this map:

`0`

represents the`obstacle`

can’t be reached.`1`

represents the`ground`

can be walked through.`The place with number bigger than 1`

represents a`tree`

can be walked through, and this positive number represents the tree’s height.

You are asked to cut off **all** the trees in this forest in the order of tree’s height - always cut off the tree with lowest height first. And after cutting, the original place has the tree will become a grass (value 1).

You will start from the point (0, 0) and you should output the minimum steps **you need to walk** to cut off all the trees. If you can’t cut off all the trees, output -1 in that situation.

You are guaranteed that no two `trees`

have the same height and there is at least one tree needs to be cut off.

**Example 1:**

```
Input:
[
[1, 2, 3],
[0, 0, 4],
[7, 6, 5]
]
Output: 6
```

**Example 2:**

```
Input:
[
[1, 2, 3],
[0, 0, 0],
[7, 6, 5]
]
Output: -1
```

**Example 3:**

```
Input:
[
[2, 3, 4],
[0, 0, 5],
[8, 7, 6]
]
Output: 6
Explanation: You started from the point (0, 0) and you can cut off the tree in (0, 0) directly without walking.
```

**Hint:** size of the given matrix will not exceed 50x50.

**Unsolved**

### Number of Longest Increasing Subsequence

Given an unsorted array of integers, find the number of longest increasing subsequence.

**Example 1:**

```
Input: [1, 3, 5, 4, 7]
Output: 2
Explanation: The two longest increasing subsequence are [1, 3, 4, 7] and [1, 3, 5, 7].
```

**Example 2:**

```
Input: [2, 2, 2, 2, 2]
Output: 5
Explanation: The length of longest continuous increasing subsequence is 1, and there are 5 subsequences' length is 1, so output 5.
```

**Note:** Length of the given array will be not exceed 2000 and the answer is guaranteed to be fit in 32-bit signed int.

**Unsolved**