You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: solution/0700-0799/0735.Asteroid Collision/README_EN.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ tags:
18
18
19
19
<!-- description:start -->
20
20
21
-
<p>We are given an array <code>asteroids</code> of integers representing asteroids in a row.</p>
21
+
<p>We are given an array <code>asteroids</code> of integers representing asteroids in a row. The indices of the asteriod in the array represent their relative position in space.</p>
22
22
23
23
<p>For each asteroid, the absolute value represents its size, and the sign represents its direction (positive meaning right, negative meaning left). Each asteroid moves at the same speed.</p>
# [3391. Design a 3D Binary Matrix with Efficient Layer Tracking 🔒](https://leetcode.cn/problems/design-a-3d-binary-matrix-with-efficient-layer-tracking)
<p>You are given a <code>n x n x n</code> <strong>binary</strong> 3D array <code>matrix</code>.</p>
17
+
<p>给定一个 <code>n x n x n</code> 的 <strong>二进制 </strong>三维数组 <code>matrix</code>。</p>
18
18
19
-
<p>Implement the <code>matrix3D</code> class:</p>
19
+
<p>实现 <code>Matrix3D</code> 类:</p>
20
20
21
21
<ul>
22
-
<li><code>matrix3D(int n)</code> Initializes the object with the 3D binary array <code>matrix</code>, where <strong>all</strong> elements are initially set to 0.</li>
23
-
<li><code>void setCell(int x, int y, int z)</code> Sets the value at <code>matrix[x][y][z]</code> to 1.</li>
24
-
<li><code>void unsetCell(int x, int y, int z)</code> Sets the value at <code>matrix[x][y][z]</code> to 0.</li>
25
-
<li><code>int largestMatrix()</code> Returns the index <code>x</code> where <code>matrix[x]</code> contains the most number of 1's. If there are multiple such indices, return the <strong>largest</strong><code>x</code>.</li>
matrix3D matrix3D = new matrix3D(3); // Initializes a <code>3 x 3 x 3</code> 3D array <code>matrix</code>, filled with all 0's.<br />
41
-
matrix3D.setCell(0, 0, 0); // Sets <code>matrix[0][0][0]</code> to 1.<br />
42
-
matrix3D.largestMatrix(); // Returns 0. <code>matrix[0]</code> has the most number of 1's.<br />
43
-
matrix3D.setCell(1, 1, 2); // Sets <code>matrix[1][1][2]</code> to 1.<br />
44
-
matrix3D.largestMatrix(); // Returns 1. <code>matrix[0]</code> and <code>matrix[1]</code> tie with the most number of 1's, but index 1 is bigger.<br />
45
-
matrix3D.setCell(0, 0, 1); // Sets <code>matrix[0][0][1]</code> to 1.<br />
46
-
matrix3D.largestMatrix(); // Returns 0. <code>matrix[0]</code> has the most number of 1's.</div>
40
+
<p><strong>解释:</strong></p>
41
+
Matrix3D matrix3D = new Matrix3D(3); // 初始化一个 <code>3 x 3 x 3</code> 的三维数组 <code>matrix</code>,用全 0 填充。<br />
<p>You are given a <code>n x n x n</code> <strong>binary</strong> 3D array <code>matrix</code>.</p>
18
18
19
-
<p>Implement the <code>matrix3D</code> class:</p>
19
+
<p>Implement the <code>Matrix3D</code> class:</p>
20
20
21
21
<ul>
22
-
<li><code>matrix3D(int n)</code> Initializes the object with the 3D binary array <code>matrix</code>, where <strong>all</strong> elements are initially set to 0.</li>
22
+
<li><code>Matrix3D(int n)</code> Initializes the object with the 3D binary array <code>matrix</code>, where <strong>all</strong> elements are initially set to 0.</li>
23
23
<li><code>void setCell(int x, int y, int z)</code> Sets the value at <code>matrix[x][y][z]</code> to 1.</li>
24
24
<li><code>void unsetCell(int x, int y, int z)</code> Sets the value at <code>matrix[x][y][z]</code> to 0.</li>
25
25
<li><code>int largestMatrix()</code> Returns the index <code>x</code> where <code>matrix[x]</code> contains the most number of 1's. If there are multiple such indices, return the <strong>largest</strong> <code>x</code>.</li>
0 commit comments