Skip to content

Commit 0dd4da3

Browse files
Update README.md
1 parent 10b9dcf commit 0dd4da3

File tree

1 file changed

+31
-9
lines changed

1 file changed

+31
-9
lines changed

README.md

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ Output: 3
1818
Input: s = "(1+(4+5+2)-3)+(6+8)"
1919
Output: 23
2020
`
21-
2221
<br>
2322

23+
24+
25+
2426
## Question 432: All O'one Data Structure
2527
Design a data structure to store the strings' count with the ability to return the strings with minimum and maximum counts.
2628

@@ -30,8 +32,19 @@ Implement the AllOne class:
3032
* `dec(String key)` Decrements the count of the string `key` by `1`. If the count of `key` is `0` after the decrement, remove it from the data structure. It is guaranteed that `key` exists in the data structure before the decrement.
3133
* `getMaxKey()` Returns one of the keys with the maximal count. If no element exists, return an empty string `""`.
3234
* `getMinKey()` Returns one of the keys with the minimum count. If no element exists, return an empty string `""`.
35+
<br>
36+
3337

38+
39+
40+
## Question 797: All Paths From Source to Target
41+
Given a directed acyclic graph (***DAG***) of `n` nodes labeled from `0` to `n - 1`, find all possible paths from node 0 to node n - 1 and return them in ***any order***.
3442
<br>
43+
The graph is given as follows: graph[i] is a list of all nodes you can visit from node i (i.e., there is a directed edge from node i to node `graph[i][j]`).
44+
<br><br><br>
45+
46+
47+
3548

3649
## Question 1046: Last Stone Weight
3750
You are given an array of integers `stones` where `stones[i]` is the weight of the i<sup>th</sup> stone. <br>
@@ -41,21 +54,29 @@ We are playing a game with the stones. On each turn, we choose the ***heaviest t
4154

4255
At the end of the game, there is ***at most one*** stone left.<br>
4356
Return the smallest ***possible weight of the left stone***. If there are no stones left, return `0`.
57+
<br><br><br>
58+
59+
60+
61+
62+
## Question 1162: As Far from Land as Possible
63+
Given an `n x n grid` containing only values `0` and `1`, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized, and return the distance. If no land or water exists in the grid, return `-1`. <br><br>
64+
The distance used in this problem is the Manhattan distance: <br>
65+
The distance between two cells `(x0, y0)` and `(x1, y1)` is `|x0 - x1| + |y0 - y1|`.
66+
<br><br><br>
67+
68+
4469

45-
<br>
4670

4771
## Question 1496: Path Crossing
4872
Given a string path, where `path[i] =` `N`, `S`, `E` or `W`, each representing moving one unit north, south, east, or west, respectively. You start at the origin `(0, 0)` on a 2D plane and walk on the path specified by path.
49-
<br>
50-
Return ***true*** if the path crosses itself at any point, that is, if at any time you are on a location you have previously visited. Return ***false*** otherwise.
73+
<br><br>
74+
Return ***true*** if the path crosses itself at any point, that is, if at any time you are on a location you have previously visited. <br>
75+
Return ***false*** otherwise.
76+
<br><br><br>
5177

52-
<br>
5378

54-
## Question 1162: As Far from Land as Possible
55-
Given an `n x n grid` containing only values `0` and `1`, where 0 represents water and 1 represents land, find a water cell such that its distance to the nearest land cell is maximized, and return the distance. If no land or water exists in the grid, return `-1`. <br>
56-
The distance used in this problem is the Manhattan distance: the distance between two cells `(x0, y0)` and `(x1, y1)` is `|x0 - x1| + |y0 - y1|`.
5779

58-
<br>
5980

6081
## Question 1609: Even Odd Tree
6182
A binary tree is named Even-Odd if it meets the following conditions: <br>
@@ -64,3 +85,4 @@ A binary tree is named Even-Odd if it meets the following conditions: <br>
6485
* For every ***odd-indexed level***, all nodes at the level have `even` integer values in ***strictly decreasing*** order (from left to right). <br>
6586

6687
Given the `root` of a binary tree, return ***true*** if the binary tree is Even-Odd, otherwise return ***false***.
88+
<br>

0 commit comments

Comments
 (0)