1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-21 13:06:47 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"27.5K\", \"totalSubmission\": \"38.5K\", \"totalAcceptedRaw\": 27486, \"totalSubmissionRaw\": 38459, \"acRate\": \"71.5%\"}",
"stats": "{\"totalAccepted\": \"27.5K\", \"totalSubmission\": \"38.5K\", \"totalAcceptedRaw\": 27533, \"totalSubmissionRaw\": 38524, \"acRate\": \"71.5%\"}",
"hints": [
"队列和栈的主要区别是元素的顺序。队列删除最旧的项,栈删除最新的项。如果你只访问最新的项,那么如何从栈中删除最旧的项?",
"我们可以通过不断地删除最新的项将这些项插入临时栈中来删除栈中最老的项直到得到一个元素为止。然后在检索到最新项后将所有元素返回。与此有关的问题是每次在一行中做几个弹出操作pop将需要O(n)的时间。我们可以优化在一行中连续弹出这一场景吗?"