diff --git a/solution/0700-0799/0737.Sentence Similarity II/README.md b/solution/0700-0799/0737.Sentence Similarity II/README.md index cdcff4c75a678..b07c7fa1c366b 100644 --- a/solution/0700-0799/0737.Sentence Similarity II/README.md +++ b/solution/0700-0799/0737.Sentence Similarity II/README.md @@ -30,7 +30,7 @@ tags:
两个句子是相似的,如果:
sentence1[i]
和 sentence2[i]
是相似的You are given two positive integers X
and Y
, and a 2D array circles
, where circles[i] = [xi, yi, ri]
denotes a circle with center at (xi, yi)
and radius ri
.
You are given two positive integers xCorner
and yCorner
, and a 2D array circles
, where circles[i] = [xi, yi, ri]
denotes a circle with center at (xi, yi)
and radius ri
.
There is a rectangle in the coordinate plane with its bottom left corner at the origin and top right corner at the coordinate (X, Y)
. You need to check whether there is a path from the bottom left corner to the top right corner such that the entire path lies inside the rectangle, does not touch or lie inside any circle, and touches the rectangle only at the two corners.
There is a rectangle in the coordinate plane with its bottom left corner at the origin and top right corner at the coordinate (xCorner, yCorner)
. You need to check whether there is a path from the bottom left corner to the top right corner such that the entire path lies inside the rectangle, does not touch or lie inside any circle, and touches the rectangle only at the two corners.
Return true
if such a path exists, and false
otherwise.
Example 1:
Input: X = 3, Y = 4, circles = [[2,1,1]]
+Input: xCorner = 3, yCorner = 4, circles = [[2,1,1]]
Output: true
@@ -45,7 +45,7 @@ tags:Example 2:
Input: X = 3, Y = 3, circles = [[1,1,2]]
+Input: xCorner = 3, yCorner = 3, circles = [[1,1,2]]
Output: false
@@ -59,7 +59,7 @@ tags:Example 3:
Input: X = 3, Y = 3, circles = [[2,1,1],[1,2,1]]
+Input: xCorner = 3, yCorner = 3, circles = [[2,1,1],[1,2,1]]
Output: false
@@ -73,7 +73,7 @@ tags:Example 4:
Input: X = 4, Y = 4, circles = [[5,5,1]]
+Input: xCorner = 4, yCorner = 4, circles = [[5,5,1]]
Output: true
@@ -86,7 +86,7 @@ tags:Constraints:
3 <= X, Y <= 109
3 <= xCorner, yCorner <= 109
1 <= circles.length <= 1000
circles[i].length == 3
1 <= xi, yi, ri <= 109
You are given a n x n
2D array grid
containing distinct elements in the range [0, n2 - 1]
.
Implement the neighborSum
class:
Implement the NeighborSum
class:
neighborSum(int [][]grid)
initializes the object.NeighborSum(int [][]grid)
initializes the object.int adjacentSum(int value)
returns the sum of elements which are adjacent neighbors of value
, that is either to the top, left, right, or bottom of value
in grid
.int diagonalSum(int value)
returns the sum of elements which are diagonal neighbors of value
, that is either to the top-left, top-right, bottom-left, or bottom-right of value
in grid
.Input:
-["neighborSum", "adjacentSum", "adjacentSum", "diagonalSum", "diagonalSum"]
+["NeighborSum", "adjacentSum", "adjacentSum", "diagonalSum", "diagonalSum"]
[[[[0, 1, 2], [3, 4, 5], [6, 7, 8]]], [1], [4], [4], [8]]
@@ -61,7 +61,7 @@ tags:Input:
-["neighborSum", "adjacentSum", "diagonalSum"]
+["NeighborSum", "adjacentSum", "diagonalSum"]
[[[[1, 2, 0, 3], [4, 7, 15, 6], [8, 9, 10, 11], [12, 13, 14, 5]]], [15], [9]]