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/0200-0299/0277.Find the Celebrity/README_EN.md
+3-1
Original file line number
Diff line number
Diff line change
@@ -22,10 +22,12 @@ tags:
22
22
23
23
<p>Now you want to find out who the celebrity is or verify that there is not one. You are only allowed to ask questions like: "Hi, A. Do you know B?" to get information about whether A knows B. You need to find out the celebrity (or verify there is not one) by asking as few questions as possible (in the asymptotic sense).</p>
24
24
25
-
<p>You are given a helper function <code>bool knows(a, b)</code> that tells you whether <code>a</code> knows <code>b</code>. Implement a function <code>int findCelebrity(n)</code>. There will be exactly one celebrity if they are at the party.</p>
25
+
<p>You are given an integer <code>n</code> and a helper function <code>bool knows(a, b)</code> that tells you whether <code>a</code> knows <code>b</code>. Implement a function <code>int findCelebrity(n)</code>. There will be exactly one celebrity if they are at the party.</p>
26
26
27
27
<p>Return <em>the celebrity's label if there is a celebrity at the party</em>. If there is no celebrity, return <code>-1</code>.</p>
28
28
29
+
<p><strong>Note</strong> that the <code>n x n</code> 2D array <code>graph</code> given as input is <strong>not</strong> directly available to you, and instead <strong>only</strong> accessible through the helper function <code>knows</code>. <code>graph[i][j] == 1</code> represents person <code>i</code> knows person <code>j</code>, wherease <code>graph[i][j] == 0</code> represents person <code>j</code> does not know person <code>i</code>.</p>
Copy file name to clipboardexpand all lines: solution/0700-0799/0782.Transform to Chessboard/README.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@ tags:
19
19
20
20
<!-- description:start -->
21
21
22
-
<p>一个 <code>n x n</code> 的二维网络 <code>board</code> 仅由 <code>0</code> 和 <code>1</code> 组成 。每次移动,你能任意交换两列或是两行的位置。</p>
22
+
<p>一个 <code>n x n</code> 的二维网络 <code>board</code> 仅由 <code>0</code> 和 <code>1</code> 组成 。每次移动,你能交换任意两列或是两行的位置。</p>
Copy file name to clipboardexpand all lines: solution/1800-1899/1861.Rotating the Box/README_EN.md
+12-45
Original file line number
Diff line number
Diff line change
@@ -20,102 +20,69 @@ tags:
20
20
21
21
<!-- description:start -->
22
22
23
-
<p>You are given an <code>m x n</code> matrix of characters <code>box</code> representing a side-view of a box. Each cell of the box is one of the following:</p>
23
+
<p>You are given an <code>m x n</code> matrix of characters <code>boxGrid</code> representing a side-view of a box. Each cell of the box is one of the following:</p>
<p>The box is rotated <strong>90 degrees clockwise</strong>, causing some of the stones to fall due to gravity. Each stone falls down until it lands on an obstacle, another stone, or the bottom of the box. Gravity <strong>does not</strong> affect the obstacles' positions, and the inertia from the box's rotation <strong>does not </strong>affect the stones' horizontal positions.</p>
36
32
37
-
<p>It is <strong>guaranteed</strong> that each stone in <code>box</code> rests on an obstacle, another stone, or the bottom of the box.</p>
33
+
<p>It is <strong>guaranteed</strong> that each stone in <code>boxGrid</code> rests on an obstacle, another stone, or the bottom of the box.</p>
38
34
39
35
<p>Return <em>an </em><code>n x m</code><em> matrix representing the box after the rotation described above</em>.</p>
Copy file name to clipboardexpand all lines: solution/1800-1899/1891.Cutting Ribbons/README_EN.md
+1-3
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,7 @@ tags:
33
33
34
34
</ul>
35
35
36
-
<p>Your goal is to obtain <code>k</code> ribbons of all the <strong>same positive integer length</strong>. You are allowed to throw away any excess ribbon as a result of cutting.</p>
37
-
38
-
<p>Return <em>the <strong>maximum</strong> possible positive integer length that you can obtain </em><code>k</code><em> ribbons of</em><em>, or </em><code>0</code><em> if you cannot obtain </em><code>k</code><em> ribbons of the same length</em>.</p>
36
+
<p>Your task is to determine the <strong>maximum</strong> length of ribbon, <code>x</code>, that allows you to cut <em>exactly</em> <code>k</code> ribbons, each of length <code>x</code>. You can discard any leftover ribbon from the cuts. If it is <strong>impossible</strong> to cut <code>k</code> ribbons of the same length, return 0.</p>
0 commit comments