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/1500-1599/1503.Last Moment Before All Ants Fall Out of a Plank/README_EN.md
+55-25
Original file line number
Diff line number
Diff line change
@@ -6,20 +6,12 @@
6
6
7
7
<p>We have a wooden plank of the length <code>n</code> <strong>units</strong>. Some ants are walking on the plank, each ant moves with speed <strong>1 unit per second</strong>. Some of the ants move to the <strong>left</strong>, the other move to the <strong>right</strong>.</p>
8
8
9
-
10
-
11
9
<p>When two ants moving in two <strong>different</strong> directions meet at some point, they change their directions and continue moving again. Assume changing directions doesn't take any additional time.</p>
12
10
13
-
14
-
15
11
<p>When an ant reaches <strong>one end</strong> of the plank at a time <code>t</code>, it falls out of the plank imediately.</p>
16
12
17
-
18
-
19
13
<p>Given an integer <code>n</code> and two integer arrays <code>left</code> and <code>right</code>, the positions of the ants moving to the left and the right. Return <em>the moment</em> when the last ant(s) fall out of the plank.</p>
20
14
21
-
22
-
23
15
<p> </p>
24
16
25
17
<p><strong>Example 1:</strong></p>
@@ -46,8 +38,6 @@ Note that the last moment when an ant was on the plank is t = 4 second, after th
0 commit comments