Skip to content

Commit 35a1047

Browse files
committed
Readme
1 parent 0247b2f commit 35a1047

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

1094-car-pooling/README.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<p>There is a car with <code>capacity</code> empty seats. The vehicle only drives east (i.e., it cannot turn around and drive west).</p>
2+
3+
<p>You are given the integer <code>capacity</code> and an array <code>trips</code> where <code>trips[i] = [numPassengers<sub>i</sub>, from<sub>i</sub>, to<sub>i</sub>]</code> indicates that the <code>i<sup>th</sup></code> trip has <code>numPassengers<sub>i</sub></code> passengers and the locations to pick them up and drop them off are <code>from<sub>i</sub></code> and <code>to<sub>i</sub></code> respectively. The locations are given as the number of kilometers due east from the car&#39;s initial location.</p>
4+
5+
<p>Return <code>true</code><em> if it is possible to pick up and drop off all passengers for all the given trips, or </em><code>false</code><em> otherwise</em>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> trips = [[2,1,5],[3,3,7]], capacity = 4
12+
<strong>Output:</strong> false
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre>
18+
<strong>Input:</strong> trips = [[2,1,5],[3,3,7]], capacity = 5
19+
<strong>Output:</strong> true
20+
</pre>
21+
22+
<p>&nbsp;</p>
23+
<p><strong>Constraints:</strong></p>
24+
25+
<ul>
26+
<li><code>1 &lt;= trips.length &lt;= 1000</code></li>
27+
<li><code>trips[i].length == 3</code></li>
28+
<li><code>1 &lt;= numPassengers<sub>i</sub> &lt;= 100</code></li>
29+
<li><code>0 &lt;= from<sub>i</sub> &lt; to<sub>i</sub> &lt;= 1000</code></li>
30+
<li><code>1 &lt;= capacity &lt;= 10<sup>5</sup></code></li>
31+
</ul>

0 commit comments

Comments
 (0)