Skip to content

Commit 064c15e

Browse files
committed
Create README - LeetHub
1 parent 17deedb commit 064c15e

File tree

1 file changed

+28
-0
lines changed
  • 2848-points-that-intersect-with-cars

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<h2><a href="https://leetcode.com/problems/points-that-intersect-with-cars/">2848. Points That Intersect With Cars</a></h2><h3>Easy</h3><hr><div><p>You are given a <strong>0-indexed</strong> 2D integer array <code>nums</code> representing the coordinates of the cars parking on a number line. For any index <code>i</code>, <code>nums[i] = [start<sub>i</sub>, end<sub>i</sub>]</code> where <code>start<sub>i</sub></code> is the starting point of the <code>i<sup>th</sup></code> car and <code>end<sub>i</sub></code> is the ending point of the <code>i<sup>th</sup></code> car.</p>
2+
3+
<p>Return <em>the number of integer points on the line that are covered with <strong>any part</strong> of a car.</em></p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> nums = [[3,6],[1,5],[4,7]]
9+
<strong>Output:</strong> 7
10+
<strong>Explanation:</strong> All the points from 1 to 7 intersect at least one car, therefore the answer would be 7.
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
15+
<pre><strong>Input:</strong> nums = [[1,3],[5,8]]
16+
<strong>Output:</strong> 7
17+
<strong>Explanation:</strong> Points intersecting at least one car are 1, 2, 3, 5, 6, 7, 8. There are a total of 7 points, therefore the answer would be 7.
18+
</pre>
19+
20+
<p>&nbsp;</p>
21+
<p><strong>Constraints:</strong></p>
22+
23+
<ul>
24+
<li><code>1 &lt;= nums.length &lt;= 100</code></li>
25+
<li><code>nums[i].length == 2</code></li>
26+
<li><code><font face="monospace">1 &lt;= start<sub>i</sub>&nbsp;&lt;= end<sub>i</sub>&nbsp;&lt;= 100</font></code></li>
27+
</ul>
28+
</div>

0 commit comments

Comments
 (0)