1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>编写一个 <code>StockSpanner</code> 类,它收集某些股票的每日报价,并返回该股票当日价格的跨度。</p>\n\n<p>今天股票价格的跨度被定义为股票价格小于或等于今天价格的最大连续日数(从今天开始往回数,包括今天)。</p>\n\n<p>例如如果未来7天股票的价格是 <code>[100, 80, 60, 70, 60, 75, 85]</code>,那么股票跨度将是 <code>[1, 1, 1, 2, 1, 4, 6]</code>。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例:</strong></p>\n\n<pre><strong>输入:</strong>[&quot;StockSpanner&quot;,&quot;next&quot;,&quot;next&quot;,&quot;next&quot;,&quot;next&quot;,&quot;next&quot;,&quot;next&quot;,&quot;next&quot;], [[],[100],[80],[60],[70],[60],[75],[85]]\n<strong>输出:</strong>[null,1,1,1,2,1,4,6]\n<strong>解释:</strong>\n首先初始化 S = StockSpanner(),然后:\nS.next(100) 被调用并返回 1\nS.next(80) 被调用并返回 1\nS.next(60) 被调用并返回 1\nS.next(70) 被调用并返回 2\nS.next(60) 被调用并返回 1\nS.next(75) 被调用并返回 4\nS.next(85) 被调用并返回 6。\n\n注意 (例如) S.next(75) 返回 4因为截至今天的最后 4 个价格\n(包括今天的价格 75) 小于或等于今天的价格。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ol>\n\t<li>调用&nbsp;<code>StockSpanner.next(int price)</code>&nbsp;时,将有&nbsp;<code>1 &lt;= price &lt;= 10^5</code>。</li>\n\t<li>每个测试用例最多可以调用&nbsp; <code>10000</code> 次 <code>StockSpanner.next</code>。</li>\n\t<li>在所有测试用例中,最多调用&nbsp;<code>150000</code>&nbsp;次&nbsp;<code>StockSpanner.next</code>。</li>\n\t<li>此问题的总时间限制减少了 50%。</li>\n</ol>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 162,
"likes": 171,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -155,7 +155,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"23.2K\", \"totalSubmission\": \"41.8K\", \"totalAcceptedRaw\": 23241, \"totalSubmissionRaw\": 41756, \"acRate\": \"55.7%\"}",
"stats": "{\"totalAccepted\": \"24K\", \"totalSubmission\": \"43.1K\", \"totalAcceptedRaw\": 23985, \"totalSubmissionRaw\": 43083, \"acRate\": \"55.7%\"}",
"hints": [],
"solution": null,
"status": null,