mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-04 23:11:41 +08:00
update
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
"translatedContent": null,
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 559,
|
||||
"likes": 560,
|
||||
"dislikes": 15,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Car Fleet\", \"titleSlug\": \"car-fleet\", \"difficulty\": \"Medium\", \"translatedTitle\": null}, {\"title\": \"Count Collisions on a Road\", \"titleSlug\": \"count-collisions-on-a-road\", \"difficulty\": \"Medium\", \"translatedTitle\": null}]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"17.9K\", \"totalSubmission\": \"34K\", \"totalAcceptedRaw\": 17872, \"totalSubmissionRaw\": 33966, \"acRate\": \"52.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"17.9K\", \"totalSubmission\": \"34K\", \"totalAcceptedRaw\": 17889, \"totalSubmissionRaw\": 33998, \"acRate\": \"52.6%\"}",
|
||||
"hints": [
|
||||
"We can simply ignore the merging of any car fleet, simply assume they cross each other. Now the aim is to find the first car to the right, which intersects with the current car before any other.",
|
||||
"Assume we have already considered all cars to the right already, now the current car is to be considered. Let’s ignore all cars with speeds higher than the current car since the current car cannot intersect with those ones. Now, all cars to the right having speed strictly less than current car are to be considered. Now, for two cars c1 and c2 with positions p1 and p2 (p1 < p2) and speed s1 and s2 (s1 > s2), if c1 and c2 intersect before the current car and c2, then c1 can never be the first car of intersection for any car to the left of current car including current car. So we can remove that car from our consideration.",
|
||||
|
Reference in New Issue
Block a user