mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-12-15 07:02:37 +08:00
Compare commits
74 Commits
2022-03-27
...
9eb643f137
| Author | SHA1 | Date | |
|---|---|---|---|
| 9eb643f137 | |||
| 3a7fe98f11 | |||
| e171f2875e | |||
| 4baa9b5a57 | |||
| 25bf8d9df8 | |||
| e5097bc0f6 | |||
| 952a47471f | |||
| 96cb474414 | |||
| 0b115f313a | |||
| 9732c4f3bc | |||
| e11824a0e7 | |||
| 6de82df1ca | |||
| 6465d37d92 | |||
| b14260345b | |||
| 0f5817758d | |||
| 6e78d50055 | |||
| 560c99b559 | |||
| 48eaf39261 | |||
| 947eefea5d | |||
| 9f463eb5f6 | |||
| 9d367dc01f | |||
| f8425bb3ee | |||
| 147005c405 | |||
| 32ab538e5f | |||
| 9ac85e5cbf | |||
| ba2e2740b3 | |||
| 23a743b5be | |||
| 8a37a26300 | |||
| 932b731690 | |||
| 5f3c3f620f | |||
| 193158abb0 | |||
| 396e839079 | |||
| a38bcc80d1 | |||
| ee13c73307 | |||
| b43009ddf3 | |||
| 068dd21d97 | |||
| 0b51c1f168 | |||
| 95eae7766c | |||
| 8f6be18759 | |||
| 96aa5b0ba0 | |||
| e9f28d863c | |||
| d928fedff8 | |||
| 6f2245ab62 | |||
| 85985929d8 | |||
| 321b55e52f | |||
| e6b8964ee2 | |||
| 561e2f5094 | |||
| 3adfcf4fee | |||
| 86906ca247 | |||
| ea34fbb843 | |||
| 210ba37692 | |||
| 8891b38740 | |||
| 6ba311f0f3 | |||
| 19b3e4846b | |||
| f1a542154c | |||
| f5bf94d67e | |||
| f3b23d1fc3 | |||
| 2a71c78585 | |||
| 7ea03594b3 | |||
| 74598d1cf8 | |||
| 7deedf5990 | |||
| 7646741306 | |||
| bc30d9a0a5 | |||
| f3e61dc093 | |||
| 55953eb844 | |||
| 9930064684 | |||
| 3eb67e218e | |||
| 1ed06f8362 | |||
| ad15da05aa | |||
| e730aa6794 | |||
| b84ae535b7 | |||
| 2b0511d272 | |||
| 58bbdfd57c | |||
| 79c876dc09 |
69
README.md
69
README.md
@@ -1,23 +1,46 @@
|
||||
# 力扣题库(完整版)
|
||||
|
||||
使用 Python 脚本分批将力扣(国外版 `leetcode.com` 和 国内版 `leetcode-cn.com`)上面的题目下载下来,方便没有网的时候进行学习。
|
||||
|
||||
### 仓库内容介绍
|
||||
|
||||
- [x] 国外版力扣题库,在仓库 `算法题(国外版)` 文件夹下(其中的 html 文件)。
|
||||
- [x] 国内版力扣题库,在仓库 `算法题(国内版)/problem (Chinese)` 文件夹下,对于同时有英文版的题目来说,英文版在仓库 `算法题(国内版)/problem (English)` 文件夹下。
|
||||
|
||||
### 一些说明
|
||||
|
||||
- 仅包含可以在网页上直接打开的公开题目,不包含 VIP 题目。
|
||||
- 当前仓库的最后更新日期为 `2022.03.27`,仓库会每隔较长的一段时间从官方网站进行题目同步,同步后本仓库将更新。
|
||||
|
||||
|
||||
|
||||
> **注意!**
|
||||
>
|
||||
> **所有版权都为 LeetCode (及力扣中国) 官方所有,此处仅供学习使用,感谢 LeetCode 平台为我们提供大量的算法题目进行练习、提升。也请大家不要滥用,不要侵犯力扣平台的合法权益。**
|
||||
|
||||
---
|
||||
|
||||
Python脚本是在网上教程的基础上进行二改得到的,原版地址:https://blog.csdn.net/weixin_37267014/article/details/81429057
|
||||
# 力扣题库(完整版)
|
||||
|
||||
> 最后更新日期: **2023.08.20**
|
||||
>
|
||||
> 使用脚本前请务必仔细完整阅读本 `README.md` 文件
|
||||
|
||||
### 仓库介绍
|
||||
|
||||
使用 Python 脚本分批将力扣(`leetcode.com` 和 `leetcode-cn.com`)上面的题目保存下来,方便没有网的时候进行学习。(仅包含可以在网页上直接打开的公开题目,不包含 VIP 题目)
|
||||
|
||||
|
||||
|
||||
### 仓库目录结构
|
||||
|
||||
国外版力扣题库,在仓库 `leetcode/problem` 文件夹下;国内版力扣题库,在仓库 `leetcode-cn/problem (Chinese)` 和 `leetcode-cn/problem (English)` 文件夹下。(部分题目只有中文版,无对应英文版)。
|
||||
|
||||
|
||||
|
||||
### 特别注意!
|
||||
|
||||
#### 版权相关
|
||||
|
||||
**所有版权都为 LeetCode (及力扣中国) 官方所有,此处仅供学习使用,不要他用。也请大家不要滥用,不要侵犯力扣平台的合法权益。**
|
||||
|
||||
**感谢 LeetCode 平台为我们提供大量的算法题目进行练习与提升。如果大家经济条件允许,请大家多多支持力扣,例如冲冲会员等。**
|
||||
|
||||
力扣题库的权益归属力扣,使用力扣题库,需要遵循力扣使用条例,若您不同意此条例,请立即关闭当前网页,不要继续使用本题库。
|
||||
|
||||
力扣(LeetCode)• 使用条例: https://leetcode-cn.com/terms-c/
|
||||
|
||||
LeetCode Terms of Service: https://leetcode.com/terms/
|
||||
|
||||
|
||||
|
||||
#### 脚本原作者
|
||||
|
||||
Python脚本是在网上教程的基础上进行二改得到的,原版地址:https://blog.csdn.net/weixin_37267014/article/details/81429057
|
||||
|
||||
|
||||
|
||||
#### 其他
|
||||
|
||||
由于脚本运行时会向力扣网站发出大量请求,所以请大家不要随便尝试此脚本,以免影响力扣网站正常运行。
|
||||
|
||||
因为使用此脚本所造成的一系列问题,责任由您自己承担,作者不承担相应责任。
|
||||
|
||||
|
||||
20
get.bat
Normal file
20
get.bat
Normal file
@@ -0,0 +1,20 @@
|
||||
git checkout master
|
||||
git pull
|
||||
|
||||
python leetcode.py
|
||||
python leetcode-cn.py
|
||||
|
||||
git status
|
||||
echo "<EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD>͵<EFBFBD> Git <20>ֿ<EFBFBD>"
|
||||
pause
|
||||
git add .
|
||||
git commit -m "update"
|
||||
git gc
|
||||
|
||||
git remote add origin https://gitee.com/coder-xiaomo/leetcode-problemset
|
||||
git push origin
|
||||
|
||||
git remote add github https://github.com/coder-xiaomo/leetcode-problemset
|
||||
git push github
|
||||
|
||||
pause
|
||||
141
leetcode-cn.py
Normal file
141
leetcode-cn.py
Normal file
@@ -0,0 +1,141 @@
|
||||
# coding:utf-8
|
||||
import re
|
||||
import json
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import requests
|
||||
from requests.exceptions import RequestException
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
def get_proble_set(url):
|
||||
try:
|
||||
response = requests.get(url)
|
||||
if response.status_code == 200:
|
||||
return response.text
|
||||
return None
|
||||
except RequestException:
|
||||
return None
|
||||
|
||||
def parse_proble_set(problemSet):
|
||||
# print(len(problemSet)) # 2573
|
||||
for i in range(len(problemSet)):
|
||||
title = problemSet[i]["stat"]["question__title_slug"]
|
||||
if os.path.exists("originData/[no content]{}.json".format(title)) or os.path.exists("originData/{}.json".format(title)):
|
||||
print(i, "has been parsed.")
|
||||
# print("The question has been parsed: {}".format(title))
|
||||
continue
|
||||
#construct_url(title)
|
||||
# time.sleep(0.5)
|
||||
time.sleep(1)
|
||||
t =threading.Thread(target=construct_url,args=(title,))
|
||||
t.start()
|
||||
print(i, "is done.")
|
||||
continue
|
||||
|
||||
def construct_url(problemTitle):
|
||||
url = "https://leetcode.cn/problems/"+ problemTitle + "/"
|
||||
# print(url)
|
||||
get_proble_content(url,problemTitle)
|
||||
|
||||
def save_problem(title,content, editorType = ""):
|
||||
#content = bytes(content,encoding = 'utf8')
|
||||
filename = title + ".html"
|
||||
if editorType == "MARKDOWN":
|
||||
filename = title + ".md"
|
||||
# else if editorType = "CKEDITOR":
|
||||
with open(filename,'w+',encoding="utf-8")as f:
|
||||
f.write(content)
|
||||
|
||||
def get_proble_content(problemUrl,title):
|
||||
# 随便请求一个页面,获取csrf_token
|
||||
response = requests.get('https://leetcode.cn/graphql/', data = '''{"operationName":"userPremiumInfo","variables":{},"query":"query userPremiumInfo {\n userStatus {\n isPremium\n subscriptionPlanType\n __typename\n }\n}\n"}''')
|
||||
setCookie = response.headers["set-cookie"]
|
||||
# print(setCookie)
|
||||
'''
|
||||
print(setCookie)
|
||||
setCookie = json.loads(setCookie)
|
||||
print(type(setCookie))
|
||||
'''
|
||||
try:
|
||||
pattern = re.compile(".*?csrftoken=(.*?);.*?",re.S)
|
||||
csrftoken = re.search(pattern, setCookie)
|
||||
# print(csrftoken.group(1))
|
||||
url = "https://leetcode.cn/graphql"
|
||||
data = {
|
||||
"operationName":"questionData",
|
||||
"variables":{"titleSlug":title},
|
||||
"query": "query questionData($titleSlug: String!) {\n question(titleSlug: $titleSlug) {\n questionId\n questionFrontendId\n categoryTitle\n boundTopicId\n title\n titleSlug\n content\n translatedTitle\n translatedContent\n isPaidOnly\n difficulty\n likes\n dislikes\n isLiked\n similarQuestions\n contributors {\n username\n profileUrl\n avatarUrl\n __typename\n }\n langToValidPlayground\n topicTags {\n name\n slug\n translatedName\n __typename\n }\n companyTagStats\n codeSnippets {\n lang\n langSlug\n code\n __typename\n }\n stats\n hints\n solution {\n id\n canSeeDetail\n __typename\n }\n status\n sampleTestCase\n metaData\n judgerAvailable\n judgeType\n mysqlSchemas\n enableRunCode\n envInfo\n book {\n id\n bookName\n pressName\n source\n shortDescription\n fullDescription\n bookImgUrl\n pressImgUrl\n productUrl\n __typename\n }\n isSubscribed\n isDailyQuestion\n dailyRecordStatus\n editorType\n ugcQuestionId\n style\n exampleTestcases\n __typename\n }\n}\n"
|
||||
}
|
||||
headers = {
|
||||
'x-csrftoken': csrftoken.group(1),
|
||||
'referer':problemUrl,
|
||||
'content-type':'application/json',
|
||||
'origin':'https://leetcode.cn',
|
||||
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.139 Safari/537.36'
|
||||
}
|
||||
cookies = {
|
||||
'__cfduid':'d9ce37537c705e759f6bea15fffc9c58b1525271602',
|
||||
'_ga':'GA1.2.5783653.1525271604',
|
||||
'_gid':'GA1.2.344320119.1533189808',
|
||||
'csrftoken':csrftoken.group(1),
|
||||
' _gat':'1'
|
||||
}
|
||||
#payload表单为json格式
|
||||
|
||||
dumpJsonData = json.dumps(data)
|
||||
response = requests.post(url,data = dumpJsonData, headers = headers,cookies = cookies)
|
||||
dictInfo = json.loads(response.text)
|
||||
# print(response.text)
|
||||
if dictInfo["data"]["question"].get("content") is not None:
|
||||
saveJSON(dictInfo, "originData/" + title + ".json")
|
||||
# 英文版
|
||||
content = dictInfo["data"]["question"]["content"]
|
||||
title = dictInfo["data"]["question"]["title"]
|
||||
|
||||
# 中文版
|
||||
translatedContent = dictInfo["data"]["question"]["translatedContent"]
|
||||
translatedTitle = dictInfo["data"]["question"]["translatedTitle"]
|
||||
titleSlug = dictInfo["data"]["question"]["titleSlug"]
|
||||
editorType = dictInfo["data"]["question"]["editorType"] # 分为 MARKDOWN 和 CKEDITOR 两种编辑器
|
||||
|
||||
# 中文版
|
||||
save_problem("problem (Chinese)/" + translatedTitle + " [{}]".format(titleSlug), translatedContent, editorType)
|
||||
# 英文版
|
||||
if content != "" and content != "<p>English description is not available for the problem. Please switch to Chinese.</p>":
|
||||
save_problem("problem (English)/" + translatedTitle + "(English) [{}]".format(titleSlug), content)
|
||||
else:
|
||||
pass # 有一些题目没有英文,那么就不保存
|
||||
else:
|
||||
saveJSON(dictInfo, "originData/[no content]" + title + ".json")
|
||||
# print("no content")
|
||||
except Exception as e:
|
||||
print("[error] ", e, problemUrl)
|
||||
|
||||
def saveJSON(data, filename):
|
||||
with open(filename, 'w', encoding='utf-8') as f:
|
||||
json.dump(data, f, ensure_ascii=False, indent=4)
|
||||
|
||||
def main():
|
||||
url = "https://leetcode.cn/api/problems/all/"
|
||||
html = json.loads(get_proble_set(url))
|
||||
saveJSON(html, "origin-data.json")
|
||||
|
||||
# html = json.load(open("origin-data.json", 'r', encoding='utf-8'))
|
||||
|
||||
problemset = html["stat_status_pairs"]
|
||||
parse_proble_set(problemset)
|
||||
|
||||
|
||||
if __name__=='__main__':
|
||||
folderName = "leetcode-cn"
|
||||
if not os.path.exists(folderName):
|
||||
os.mkdir(folderName)
|
||||
if not os.path.exists(folderName + "/originData"):
|
||||
os.mkdir(folderName + "/originData")
|
||||
if not os.path.exists(folderName + "/problem (Chinese)"):
|
||||
os.mkdir(folderName + "/problem (Chinese)")
|
||||
if not os.path.exists(folderName + "/problem (English)"):
|
||||
os.mkdir(folderName + "/problem (English)")
|
||||
os.chdir(folderName)
|
||||
main()
|
||||
67759
leetcode-cn/origin-data.json
Normal file
67759
leetcode-cn/origin-data.json
Normal file
File diff suppressed because it is too large
Load Diff
180
leetcode-cn/originData/01-matrix.json
Normal file
180
leetcode-cn/originData/01-matrix.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "「力扣挑战赛」有 `n` 个比赛场馆(场馆编号从 `0` 开始),场馆之间的通道分布情况记录于二维数组 `edges` 中,`edges[i]= [x, y]` 表示第 `i` 条通道连接场馆 `x` 和场馆 `y`(即两个场馆相邻)。初始每个场馆中都有一定人数的志愿者(不同场馆人数可能不同),后续 `m` 天每天均会根据赛事热度进行志愿者人数调配。调配方案分为如下三种:\n1. 将编号为 `idx` 的场馆内的志愿者人数减半;\n2. 将编号为 `idx` 的场馆相邻的场馆的志愿者人数都加上编号为 `idx` 的场馆的志愿者人数;\n3. 将编号为 `idx` 的场馆相邻的场馆的志愿者人数都减去编号为 `idx` 的场馆的志愿者人数。\n\n所有的调配信息记录于数组 `plans` 中,`plans[i] = [num,idx]` 表示第 `i` 天对编号 `idx` 的场馆执行了第 `num` 种调配方案。\n在比赛结束后对调配方案进行复盘时,不慎将第 `0` 个场馆的**最终**志愿者人数丢失,只保留了**初始**所有场馆的志愿者总人数 `totalNum` ,以及记录了第 `1 ~ n-1` 个场馆的**最终**志愿者人数的一维数组 `finalCnt`。请你根据现有的信息求出初始每个场馆的志愿者人数,并按场馆编号顺序返回志愿者人数列表。\n\n**注意:**\n- 测试数据保证当某场馆进行第一种调配时,该场馆的志愿者人数一定为偶数;\n- 测试数据保证当某场馆进行第三种调配时,该场馆的相邻场馆志愿者人数不为负数;\n- 测试数据保证比赛开始时每个场馆的志愿者人数都不超过 `10^9`;\n- 测试数据保证给定的场馆间的道路分布情况中不会出现自环、重边的情况。\n\n\n**示例 1:**\n>\n> 输入:\n>`finalCnt = [1,16], totalNum = 21, edges = [[0,1],[1,2]], plans = [[2,1],[1,0],[3,0]]`\n>\n> 输出:`[5,7,9]`\n>\n> 解释:\n> {:height=200}\n\n\n**示例 2 :**\n> 输入:\n>`finalCnt = [4,13,4,3,8], totalNum = 54, edges = [[0,3],[1,3],[4,3],[2,3],[2,5]], plans = [[1,1],[3,3],[2,5],[1,0]]`\n>\n> 输出:`[10,16,9,4,7,8]`\n\n\n\n**提示:**\n- `2 <= n <= 5*10^4`\n- `1 <= edges.length <= min((n * (n - 1)) / 2, 5*10^4)`\n- `0 <= edges[i][0], edges[i][1] < n`\n- `1 <= plans.length <= 10`\n- `1 <= plans[i][0] <=3`\n- `0 <= plans[i][1] < n`\n- `finalCnt.length = n-1`\n- `0 <= finalCnt[i] < 10^9`\n- `0 <= totalNum < 5*10^13`\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 2,
|
||||
"likes": 4,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"2.7K\", \"totalAcceptedRaw\": 1121, \"totalSubmissionRaw\": 2724, \"acRate\": \"41.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.2K\", \"totalSubmission\": \"2.9K\", \"totalAcceptedRaw\": 1242, \"totalSubmissionRaw\": 2899, \"acRate\": \"42.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定两个数组,<code>arr1</code> 和 <code>arr2</code>,</p>\n\n<ul>\n\t<li><code>arr2</code> 中的元素各不相同</li>\n\t<li><code>arr2</code> 中的每个元素都出现在 <code>arr1</code> 中</li>\n</ul>\n\n<p>对 <code>arr1</code> 中的元素进行排序,使 <code>arr1</code> 中项的相对顺序和 <code>arr2</code> 中的相对顺序相同。未在 <code>arr2</code> 中出现过的元素需要按照升序放在 <code>arr1</code> 的末尾。</p>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr1 = [2,3,1,3,2,4,6,7,9,2,19], arr2 = [2,1,4,3,9,6]\n<strong>输出:</strong>[2,2,2,1,4,3,3,9,6,7,19]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= arr1.length, arr2.length <= 1000</code></li>\n\t<li><code>0 <= arr1[i], arr2[i] <= 1000</code></li>\n\t<li><code>arr2</code> 中的元素 <code>arr2[i]</code> 各不相同</li>\n\t<li><code>arr2</code> 中的每个元素 <code>arr2[i]</code> 都出现在 <code>arr1</code> 中</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 1122 题相同:<a href=\"https://leetcode-cn.com/problems/relative-sort-array/\">https://leetcode-cn.com/problems/relative-sort-array/</a> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 21,
|
||||
"likes": 24,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.1K\", \"totalSubmission\": \"12.9K\", \"totalAcceptedRaw\": 9135, \"totalSubmissionRaw\": 12949, \"acRate\": \"70.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11K\", \"totalSubmission\": \"15.5K\", \"totalAcceptedRaw\": 10973, \"totalSubmissionRaw\": 15508, \"acRate\": \"70.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
161
leetcode-cn/originData/0Zeoeg.json
Normal file
161
leetcode-cn/originData/0Zeoeg.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个包含非负整数的 <code><em>m</em> x <em>n</em></code> 网格 <code>grid</code> ,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。</p>\n\n<p><strong>说明:</strong>一个机器人每次只能向下或者向右移动一步。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/11/05/minpath.jpg\" style=\"width: 242px; height: 242px;\" /></p>\n\n<pre>\n<strong>输入:</strong>grid = [[1,3,1],[1,5,1],[4,2,1]]\n<strong>输出:</strong>7\n<strong>解释:</strong>因为路径 1→3→1→1→1 的总和最小。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>grid = [[1,2,3],[4,5,6]]\n<strong>输出:</strong>12\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == grid.length</code></li>\n\t<li><code>n == grid[i].length</code></li>\n\t<li><code>1 <= m, n <= 200</code></li>\n\t<li><code>0 <= grid[i][j] <= 100</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 64 题相同: <a href=\"https://leetcode-cn.com/problems/minimum-path-sum/\">https://leetcode-cn.com/problems/minimum-path-sum/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 16,
|
||||
"likes": 17,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.2K\", \"totalSubmission\": \"11.3K\", \"totalAcceptedRaw\": 8152, \"totalSubmissionRaw\": 11256, \"acRate\": \"72.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.8K\", \"totalSubmission\": \"13.5K\", \"totalAcceptedRaw\": 9785, \"totalSubmissionRaw\": 13516, \"acRate\": \"72.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.1K\", \"totalSubmission\": \"9.7K\", \"totalAcceptedRaw\": 5098, \"totalSubmissionRaw\": 9699, \"acRate\": \"52.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.4K\", \"totalSubmission\": \"10.3K\", \"totalAcceptedRaw\": 5439, \"totalSubmissionRaw\": 10282, \"acRate\": \"52.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个只包含数字的字符串 <code>s</code> ,用以表示一个 IP 地址,返回所有可能从 <code>s</code> 获得的 <strong>有效 IP 地址 </strong>。你可以按任何顺序返回答案。</p>\n\n<p><strong>有效 IP 地址</strong> 正好由四个整数(每个整数位于 0 到 255 之间组成,且不能含有前导 <code>0</code>),整数之间用 <code>'.'</code> 分隔。</p>\n\n<p>例如:"0.1.2.201" 和 "192.168.1.1" 是 <strong>有效</strong> IP 地址,但是 "0.011.255.245"、"192.168.1.312" 和 "192.168@1.1" 是 <strong>无效</strong> IP 地址。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "25525511135"\n<strong>输出:</strong>["255.255.11.135","255.255.111.35"]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "0000"\n<strong>输出:</strong>["0.0.0.0"]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "1111"\n<strong>输出:</strong>["1.1.1.1"]\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "010010"\n<strong>输出:</strong>["0.10.0.10","0.100.1.0"]\n</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "10203040"\n<strong>输出:</strong>["10.20.30.40","102.0.30.40","10.203.0.40"]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= s.length <= 3000</code></li>\n\t<li><code>s</code> 仅由数字组成</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 93 题相同:<a href=\"https://leetcode-cn.com/problems/restore-ip-addresses/\">https://leetcode-cn.com/problems/restore-ip-addresses/</a> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 20,
|
||||
"likes": 23,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.4K\", \"totalSubmission\": \"11.7K\", \"totalAcceptedRaw\": 7378, \"totalSubmissionRaw\": 11675, \"acRate\": \"63.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"8.7K\", \"totalSubmission\": \"13.9K\", \"totalAcceptedRaw\": 8710, \"totalSubmissionRaw\": 13857, \"acRate\": \"62.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定非负整数数组 <code>heights</code> ,数组中的数字用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 <code>1</code> 。</p>\n\n<p>求在该柱状图中,能够勾勒出来的矩形的最大面积。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/01/04/histogram.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong>heights = [2,1,5,6,2,3]\n<strong>输出:</strong>10\n<strong>解释:</strong>最大的矩形为图中红色区域,面积为 10\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/01/04/histogram-1.jpg\" /></p>\n\n<pre>\n<strong>输入:</strong> heights = [2,4]\n<b>输出:</b> 4</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= heights.length <=10<sup>5</sup></code></li>\n\t<li><code>0 <= heights[i] <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 84 题相同: <a href=\"https://leetcode-cn.com/problems/largest-rectangle-in-histogram/\">https://leetcode-cn.com/problems/largest-rectangle-in-histogram/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 30,
|
||||
"likes": 38,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9K\", \"totalSubmission\": \"17.9K\", \"totalAcceptedRaw\": 8978, \"totalSubmissionRaw\": 17894, \"acRate\": \"50.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11K\", \"totalSubmission\": \"21.9K\", \"totalAcceptedRaw\": 11020, \"totalSubmissionRaw\": 21881, \"acRate\": \"50.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
164
leetcode-cn/originData/1-bit-and-2-bit-characters.json
Normal file
164
leetcode-cn/originData/1-bit-and-2-bit-characters.json
Normal file
File diff suppressed because one or more lines are too long
186
leetcode-cn/originData/132-pattern.json
Normal file
186
leetcode-cn/originData/132-pattern.json
Normal file
File diff suppressed because one or more lines are too long
162
leetcode-cn/originData/1GxJYY.json
Normal file
162
leetcode-cn/originData/1GxJYY.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个包含 <code>n</code> 个整数的数组 <code>nums</code>,判断 <code>nums</code> 中是否存在三个元素 <code>a</code> ,<code>b</code> ,<code>c</code> <em>,</em>使得 <code>a + b + c = 0</code> ?请找出所有和为 <code>0</code> 且 <strong>不重复 </strong>的三元组。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [-1,0,1,2,-1,-4]\n<strong>输出:</strong>[[-1,-1,2],[-1,0,1]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = []\n<strong>输出:</strong>[]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [0]\n<strong>输出:</strong>[]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= nums.length <= 3000</code></li>\n\t<li><code>-10<sup>5</sup> <= nums[i] <= 10<sup>5</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 15 题相同:<a href=\"https://leetcode-cn.com/problems/3sum/\">https://leetcode-cn.com/problems/3sum/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 45,
|
||||
"likes": 53,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"21.5K\", \"totalSubmission\": \"48.4K\", \"totalAcceptedRaw\": 21515, \"totalSubmissionRaw\": 48407, \"acRate\": \"44.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"25.2K\", \"totalSubmission\": \"57.1K\", \"totalAcceptedRaw\": 25250, \"totalSubmissionRaw\": 57070, \"acRate\": \"44.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>输入一个整数 <code>n</code> ,求1~n这n个整数的十进制表示中1出现的次数。</p>\n\n<p>例如,输入12,1~12这些整数中包含1 的数字有1、10、11和12,1一共出现了5次。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 12\n<strong>输出:</strong>5\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 13\n<strong>输出:</strong>6</pre>\n\n<p> </p>\n\n<p><strong>限制:</strong></p>\n\n<ul>\n\t<li><code>1 <= n < 2^31</code></li>\n</ul>\n\n<p>注意:本题与主站 233 题相同:<a href=\"https://leetcode-cn.com/problems/number-of-digit-one/\">https://leetcode-cn.com/problems/number-of-digit-one/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 302,
|
||||
"likes": 317,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"62.2K\", \"totalSubmission\": \"125.1K\", \"totalAcceptedRaw\": 62157, \"totalSubmissionRaw\": 125071, \"acRate\": \"49.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"65.3K\", \"totalSubmission\": \"131.1K\", \"totalAcceptedRaw\": 65333, \"totalSubmissionRaw\": 131127, \"acRate\": \"49.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
161
leetcode-cn/originData/1ybDKD.json
Normal file
161
leetcode-cn/originData/1ybDKD.json
Normal file
File diff suppressed because one or more lines are too long
170
leetcode-cn/originData/2-keys-keyboard.json
Normal file
170
leetcode-cn/originData/2-keys-keyboard.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个字符串 <code>s</code><strong> </strong>和一个字符串 <code>t</code> ,计算在 <code>s</code> 的子序列中 <code>t</code> 出现的个数。</p>\n\n<p>字符串的一个 <strong>子序列</strong> 是指,通过删除一些(也可以不删除)字符且不干扰剩余字符相对位置所组成的新字符串。(例如,<code>"ACE"</code> 是 <code>"ABCDE"</code> 的一个子序列,而 <code>"AEC"</code> 不是)</p>\n\n<p>题目数据保证答案符合 32 位带符号整数范围。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "rabbbit", t = "rabbit"<code>\n<strong>输出</strong></code><strong>:</strong><code>3\n</code><strong>解释:</strong>\n如下图所示, 有 3 种可以从 s 中得到 <code>"rabbit" 的方案</code>。\n<code><strong><u>rabb</u></strong>b<strong><u>it</u></strong></code>\n<code><strong><u>ra</u></strong>b<strong><u>bbit</u></strong></code>\n<code><strong><u>rab</u></strong>b<strong><u>bit</u></strong></code></pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "babgbag", t = "bag"\n<code><strong>输出</strong></code><strong>:</strong><code>5\n</code><strong>解释:</strong>\n如下图所示, 有 5 种可以从 s 中得到 <code>"bag" 的方案</code>。 \n<code><strong><u>ba</u></strong>b<u><strong>g</strong></u>bag</code>\n<code><strong><u>ba</u></strong>bgba<strong><u>g</u></strong></code>\n<code><u><strong>b</strong></u>abgb<strong><u>ag</u></strong></code>\n<code>ba<u><strong>b</strong></u>gb<u><strong>ag</strong></u></code>\n<code>babg<strong><u>bag</u></strong></code>\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= s.length, t.length <= 1000</code></li>\n\t<li><code>s</code> 和 <code>t</code> 由英文字母组成</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 115 题相同: <a href=\"https://leetcode-cn.com/problems/distinct-subsequences/\">https://leetcode-cn.com/problems/distinct-subsequences/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 14,
|
||||
"likes": 18,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.1K\", \"totalSubmission\": \"7.7K\", \"totalAcceptedRaw\": 4140, \"totalSubmissionRaw\": 7740, \"acRate\": \"53.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.1K\", \"totalSubmission\": \"9.4K\", \"totalAcceptedRaw\": 5108, \"totalSubmissionRaw\": 9439, \"acRate\": \"54.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
178
leetcode-cn/originData/24-game.json
Normal file
178
leetcode-cn/originData/24-game.json
Normal file
File diff suppressed because one or more lines are too long
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.7K\", \"totalSubmission\": \"8.7K\", \"totalAcceptedRaw\": 6652, \"totalSubmissionRaw\": 8720, \"acRate\": \"76.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"8K\", \"totalSubmission\": \"10.5K\", \"totalAcceptedRaw\": 8044, \"totalSubmissionRaw\": 10529, \"acRate\": \"76.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个含有 <code>n</code><strong> </strong>个正整数的数组和一个正整数 <code>target</code><strong> 。</strong></p>\n\n<p>找出该数组中满足其和<strong> </strong><code>≥ target</code><strong> </strong>的长度最小的 <strong>连续子数组</strong> <code>[nums<sub>l</sub>, nums<sub>l+1</sub>, ..., nums<sub>r-1</sub>, nums<sub>r</sub>]</code> ,并返回其长度<strong>。</strong>如果不存在符合条件的子数组,返回 <code>0</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>target = 7, nums = [2,3,1,2,4,3]\n<strong>输出:</strong>2\n<strong>解释:</strong>子数组 <code>[4,3]</code> 是该条件下的长度最小的子数组。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>target = 4, nums = [1,4,4]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>target = 11, nums = [1,1,1,1,1,1,1,1]\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p>提示:</p>\n\n<ul>\n\t<li><code>1 <= target <= 10<sup>9</sup></code></li>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>1 <= nums[i] <= 10<sup>5</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p>进阶:</p>\n\n<ul>\n\t<li>如果你已经实现<em> </em><code>O(n)</code> 时间复杂度的解法, 请尝试设计一个 <code>O(n log(n))</code> 时间复杂度的解法。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 209 题相同:<a href=\"https://leetcode-cn.com/problems/minimum-size-subarray-sum/\">https://leetcode-cn.com/problems/minimum-size-subarray-sum/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 49,
|
||||
"likes": 61,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"21.7K\", \"totalSubmission\": \"44.2K\", \"totalAcceptedRaw\": 21711, \"totalSubmissionRaw\": 44181, \"acRate\": \"49.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"25.7K\", \"totalSubmission\": \"52.5K\", \"totalAcceptedRaw\": 25655, \"totalSubmissionRaw\": 52515, \"acRate\": \"48.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个由 <code>0</code> 和 <code>1</code> 组成的矩阵 <code>mat</code> ,请输出一个大小相同的矩阵,其中每一个格子是 <code>mat</code> 中对应位置元素到最近的 <code>0</code> 的距离。</p>\n\n<p>两个相邻元素间的距离为 <code>1</code> 。</p>\n\n<p> </p>\n\n<p><b>示例 1:</b></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626667201-NCWmuP-image.png\" style=\"width: 150px; \" /></p>\n\n<pre>\n<strong>输入:</strong>mat =<strong> </strong>[[0,0,0],[0,1,0],[0,0,0]]\n<strong>输出:</strong>[[0,0,0],[0,1,0],[0,0,0]]\n</pre>\n\n<p><b>示例 2:</b></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626667205-xFxIeK-image.png\" style=\"width: 150px; \" /></p>\n\n<pre>\n<b>输入:</b>mat =<b> </b>[[0,0,0],[0,1,0],[1,1,1]]\n<strong>输出:</strong>[[0,0,0],[0,1,0],[1,2,1]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == mat.length</code></li>\n\t<li><code>n == mat[i].length</code></li>\n\t<li><code>1 <= m, n <= 10<sup>4</sup></code></li>\n\t<li><code>1 <= m * n <= 10<sup>4</sup></code></li>\n\t<li><code>mat[i][j] is either 0 or 1.</code></li>\n\t<li><code>mat</code> 中至少有一个 <code>0 </code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 542 题相同:<a href=\"https://leetcode-cn.com/problems/01-matrix/\">https://leetcode-cn.com/problems/01-matrix/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 16,
|
||||
"likes": 19,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.4K\", \"totalSubmission\": \"8.4K\", \"totalAcceptedRaw\": 4436, \"totalSubmissionRaw\": 8357, \"acRate\": \"53.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.5K\", \"totalSubmission\": \"10.4K\", \"totalAcceptedRaw\": 5477, \"totalSubmissionRaw\": 10370, \"acRate\": \"52.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"20K\", \"totalSubmission\": \"68.1K\", \"totalAcceptedRaw\": 20002, \"totalSubmissionRaw\": 68085, \"acRate\": \"29.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"20.6K\", \"totalSubmission\": \"69.7K\", \"totalAcceptedRaw\": 20586, \"totalSubmissionRaw\": 69667, \"acRate\": \"29.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个二叉树的根节点 <code>root</code> ,树中每个节点都存放有一个 <code>0</code> 到 <code>9</code> 之间的数字。</p>\n\n<div class=\"original__bRMd\">\n<div>\n<p>每条从根节点到叶节点的路径都代表一个数字:</p>\n\n<ul>\n\t<li>例如,从根节点到叶节点的路径 <code>1 -> 2 -> 3</code> 表示数字 <code>123</code> 。</li>\n</ul>\n\n<p>计算从根节点到叶节点生成的 <strong>所有数字之和</strong> 。</p>\n\n<p><strong>叶节点</strong> 是指没有子节点的节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/02/19/num1tree.jpg\" style=\"width: 212px; height: 182px;\" />\n<pre>\n<strong>输入:</strong>root = [1,2,3]\n<strong>输出:</strong>25\n<strong>解释:</strong>\n从根到叶子节点路径 <code>1->2</code> 代表数字 <code>12</code>\n从根到叶子节点路径 <code>1->3</code> 代表数字 <code>13</code>\n因此,数字总和 = 12 + 13 = <code>25</code></pre>\n\n<p><strong>示例 2:</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2021/02/19/num2tree.jpg\" style=\"width: 292px; height: 302px;\" />\n<pre>\n<strong>输入:</strong>root = [4,9,0,5,1]\n<strong>输出:</strong>1026\n<strong>解释:</strong>\n从根到叶子节点路径 <code>4->9->5</code> 代表数字 495\n从根到叶子节点路径 <code>4->9->1</code> 代表数字 491\n从根到叶子节点路径 <code>4->0</code> 代表数字 40\n因此,数字总和 = 495 + 491 + 40 = <code>1026</code>\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树中节点的数目在范围 <code>[1, 1000]</code> 内</li>\n\t<li><code>0 <= Node.val <= 9</code></li>\n\t<li>树的深度不超过 <code>10</code></li>\n</ul>\n</div>\n</div>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 129 题相同: <a href=\"https://leetcode-cn.com/problems/sum-root-to-leaf-numbers/\">https://leetcode-cn.com/problems/sum-root-to-leaf-numbers/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 20,
|
||||
"likes": 23,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.4K\", \"totalSubmission\": \"13.8K\", \"totalAcceptedRaw\": 10444, \"totalSubmissionRaw\": 13830, \"acRate\": \"75.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.6K\", \"totalSubmission\": \"16.8K\", \"totalAcceptedRaw\": 12584, \"totalSubmissionRaw\": 16842, \"acRate\": \"74.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/3aqs1c.json
Normal file
162
leetcode-cn/originData/3aqs1c.json
Normal file
File diff suppressed because one or more lines are too long
174
leetcode-cn/originData/3sum-closest.json
Normal file
174
leetcode-cn/originData/3sum-closest.json
Normal file
File diff suppressed because one or more lines are too long
186
leetcode-cn/originData/3sum-with-multiplicity.json
Normal file
186
leetcode-cn/originData/3sum-with-multiplicity.json
Normal file
File diff suppressed because one or more lines are too long
178
leetcode-cn/originData/3sum.json
Normal file
178
leetcode-cn/originData/3sum.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定两个单链表的头节点 <code>headA</code> 和 <code>headB</code> ,请找出并返回两个单链表相交的起始节点。如果两个链表没有交点,返回 <code>null</code> 。</p>\n\n<p>图示两个链表在节点 <code>c1</code> 开始相交<strong>:</strong></p>\n\n<p><a href=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/14/160_statement.png\" target=\"_blank\"><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/14/160_statement.png\" style=\"height: 130px; width: 400px;\" /></a></p>\n\n<p>题目数据 <strong>保证</strong> 整个链式结构中不存在环。</p>\n\n<p><strong>注意</strong>,函数返回结果后,链表必须 <strong>保持其原始结构</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><a href=\"https://assets.leetcode.com/uploads/2018/12/13/160_example_1.png\" target=\"_blank\"><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/14/160_example_1.png\" style=\"height: 130px; width: 400px;\" /></a></p>\n\n<pre>\n<strong>输入:</strong>intersectVal = 8, listA = [4,1,8,4,5], listB = [5,0,1,8,4,5], skipA = 2, skipB = 3\n<strong>输出:</strong>Intersected at '8'\n<strong>解释:</strong>相交节点的值为 8 (注意,如果两个链表相交则不能为 0)。\n从各自的表头开始算起,链表 A 为 [4,1,8,4,5],链表 B 为 [5,0,1,8,4,5]。\n在 A 中,相交节点前有 2 个节点;在 B 中,相交节点前有 3 个节点。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><a href=\"https://assets.leetcode.com/uploads/2018/12/13/160_example_2.png\" target=\"_blank\"><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/14/160_example_2.png\" style=\"height: 136px; width: 350px;\" /></a></p>\n\n<pre>\n<strong>输入:</strong>intersectVal = 2, listA = [0,9,1,2,4], listB = [3,2,4], skipA = 3, skipB = 1\n<strong>输出:</strong>Intersected at '2'\n<strong>解释:</strong>相交节点的值为 2 (注意,如果两个链表相交则不能为 0)。\n从各自的表头开始算起,链表 A 为 [0,9,1,2,4],链表 B 为 [3,2,4]。\n在 A 中,相交节点前有 3 个节点;在 B 中,相交节点前有 1 个节点。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<p><a href=\"https://assets.leetcode.com/uploads/2018/12/13/160_example_3.png\" target=\"_blank\"><img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/12/14/160_example_3.png\" style=\"height: 126px; width: 200px;\" /></a></p>\n\n<pre>\n<strong>输入:</strong>intersectVal = 0, listA = [2,6,4], listB = [1,5], skipA = 3, skipB = 2\n<strong>输出:</strong>null\n<strong>解释:</strong>从各自的表头开始算起,链表 A 为 [2,6,4],链表 B 为 [1,5]。\n由于这两个链表不相交,所以 intersectVal 必须为 0,而 skipA 和 skipB 可以是任意值。\n这两个链表不相交,因此返回 null 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>listA</code> 中节点数目为 <code>m</code></li>\n\t<li><code>listB</code> 中节点数目为 <code>n</code></li>\n\t<li><code>0 <= m, n <= 3 * 10<sup>4</sup></code></li>\n\t<li><code>1 <= Node.val <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= skipA <= m</code></li>\n\t<li><code>0 <= skipB <= n</code></li>\n\t<li>如果 <code>listA</code> 和 <code>listB</code> 没有交点,<code>intersectVal</code> 为 <code>0</code></li>\n\t<li>如果 <code>listA</code> 和 <code>listB</code> 有交点,<code>intersectVal == listA[skipA + 1] == listB[skipB + 1]</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>能否设计一个时间复杂度 <code>O(n)</code> 、仅用 <code>O(1)</code> 内存的解决方案?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 160 题相同:<a href=\"https://leetcode-cn.com/problems/intersection-of-two-linked-lists/\">https://leetcode-cn.com/problems/intersection-of-two-linked-lists/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 30,
|
||||
"likes": 34,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -132,7 +132,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"16.7K\", \"totalSubmission\": \"23.8K\", \"totalAcceptedRaw\": 16666, \"totalSubmissionRaw\": 23848, \"acRate\": \"69.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"19.5K\", \"totalSubmission\": \"27.9K\", \"totalAcceptedRaw\": 19543, \"totalSubmissionRaw\": 27944, \"acRate\": \"69.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个可能有重复数字的整数数组 <code>candidates</code> 和一个目标数 <code>target</code> ,找出 <code>candidates</code> 中所有可以使数字和为 <code>target</code> 的组合。</p>\n\n<p><code>candidates</code> 中的每个数字在每个组合中只能使用一次,解集不能包含重复的组合。 </p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> candidates = <code>[10,1,2,7,6,1,5]</code>, target = <code>8</code>,\n<strong>输出:</strong>\n[\n[1,1,6],\n[1,2,5],\n[1,7],\n[2,6]\n]</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> candidates = [2,5,2,1,2], target = 5,\n<strong>输出:</strong>\n[\n[1,2,2],\n[5]\n]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= candidates.length <= 100</code></li>\n\t<li><code>1 <= candidates[i] <= 50</code></li>\n\t<li><code>1 <= target <= 30</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 40 题相同: <a href=\"https://leetcode-cn.com/problems/combination-sum-ii/\">https://leetcode-cn.com/problems/combination-sum-ii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 18,
|
||||
"likes": 20,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9K\", \"totalSubmission\": \"13.7K\", \"totalAcceptedRaw\": 8954, \"totalSubmissionRaw\": 13708, \"acRate\": \"65.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.4K\", \"totalSubmission\": \"15.9K\", \"totalAcceptedRaw\": 10418, \"totalSubmissionRaw\": 15895, \"acRate\": \"65.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
168
leetcode-cn/originData/4sum-ii.json
Normal file
168
leetcode-cn/originData/4sum-ii.json
Normal file
File diff suppressed because one or more lines are too long
174
leetcode-cn/originData/4sum.json
Normal file
174
leetcode-cn/originData/4sum.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定<strong>循环单调非递减列表</strong>中的一个点,写一个函数向这个列表中插入一个新元素 <code>insertVal</code> ,使这个列表仍然是循环升序的。</p>\n\n<p>给定的可以是这个列表中任意一个顶点的指针,并不一定是这个列表中最小元素的指针。</p>\n\n<p>如果有多个满足条件的插入位置,可以选择任意一个位置插入新的值,插入后整个列表仍然保持有序。</p>\n\n<p>如果列表为空(给定的节点是 <code>null</code>),需要创建一个循环有序列表并返回这个节点。否则。请返回原先给定的节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/01/19/example_1_before_65p.jpg\" style=\"height: 149px; width: 250px;\" /><br />\n </p>\n\n<pre>\n<strong>输入:</strong>head = [3,4,1], insertVal = 2\n<strong>输出:</strong>[3,4,1,2]\n<strong>解释:</strong>在上图中,有一个包含三个元素的循环有序列表,你获得值为 3 的节点的指针,我们需要向表中插入元素 2 。新插入的节点应该在 1 和 3 之间,插入之后,整个列表如上图所示,最后返回节点 3 。\n\n<img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/01/19/example_1_after_65p.jpg\" style=\"height: 149px; width: 250px;\" />\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [], insertVal = 1\n<strong>输出:</strong>[1]\n<strong>解释:</strong>列表为空(给定的节点是 <code>null</code>),创建一个循环有序列表并返回这个节点。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [1], insertVal = 0\n<strong>输出:</strong>[1,0]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= Number of Nodes <= 5 * 10^4</code></li>\n\t<li><code><font face=\"monospace\">-10^6 <= Node.val <= 10^6</font></code></li>\n\t<li><code>-10^6 <= insertVal <= 10^6</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 708 题相同: <a href=\"https://leetcode-cn.com/problems/insert-into-a-sorted-circular-linked-list/\">https://leetcode-cn.com/problems/insert-into-a-sorted-circular-linked-list/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 34,
|
||||
"likes": 42,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -120,7 +120,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.7K\", \"totalSubmission\": \"31.8K\", \"totalAcceptedRaw\": 9743, \"totalSubmissionRaw\": 31847, \"acRate\": \"30.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11.7K\", \"totalSubmission\": \"38.3K\", \"totalAcceptedRaw\": 11741, \"totalSubmissionRaw\": 38297, \"acRate\": \"30.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "小力将 N 个零件的报价存于数组 `nums`。小力预算为 `target`,假定小力仅购买两个零件,要求购买零件的花费不超过预算,请问他有多少种采购方案。\n\n注意:答案需要以 `1e9 + 7 (1000000007)` 为底取模,如:计算初始结果为:`1000000008`,请返回 `1`\n\n\n**示例 1:**\n>输入:`nums = [2,5,3,5], target = 6`\n>\n>输出:`1`\n>\n>解释:预算内仅能购买 nums[0] 与 nums[2]。\n\n**示例 2:**\n>输入:`nums = [2,2,1,9], target = 10`\n>\n>输出:`4`\n>\n>解释:符合预算的采购方案如下:\n>nums[0] + nums[1] = 4\n>nums[0] + nums[2] = 3\n>nums[1] + nums[2] = 3\n>nums[2] + nums[3] = 10\n\n**提示:**\n- `2 <= nums.length <= 10^5`\n- `1 <= nums[i], target <= 10^5`\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 42,
|
||||
"likes": 47,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"13.5K\", \"totalSubmission\": \"45.1K\", \"totalAcceptedRaw\": 13502, \"totalSubmissionRaw\": 45139, \"acRate\": \"29.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"14.5K\", \"totalSubmission\": \"47.5K\", \"totalAcceptedRaw\": 14478, \"totalSubmissionRaw\": 47544, \"acRate\": \"30.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个 24 小时制(小时:分钟 <strong>"HH:MM"</strong>)的时间列表,找出列表中任意两个时间的最小时间差并以分钟数表示。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>timePoints = ["23:59","00:00"]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>timePoints = ["00:00","23:59","00:00"]\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= timePoints <= 2 * 10<sup>4</sup></code></li>\n\t<li><code>timePoints[i]</code> 格式为 <strong>"HH:MM"</strong></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 539 题相同: <a href=\"https://leetcode-cn.com/problems/minimum-time-difference/\">https://leetcode-cn.com/problems/minimum-time-difference/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 13,
|
||||
"likes": 16,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.1K\", \"totalSubmission\": \"15.1K\", \"totalAcceptedRaw\": 10111, \"totalSubmissionRaw\": 15147, \"acRate\": \"66.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.3K\", \"totalSubmission\": \"18.4K\", \"totalAcceptedRaw\": 12294, \"totalSubmissionRaw\": 18433, \"acRate\": \"66.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "小扣在秋日市集入口处发现了一个数字游戏。主办方共有 `N` 个计数器,计数器编号为 `0 ~ N-1`。每个计数器上分别显示了一个数字,小扣按计数器编号升序将所显示的数字记于数组 `nums`。每个计数器上有两个按钮,分别可以实现将显示数字加一或减一。小扣每一次操作可以选择一个计数器,按下加一或减一按钮。\n\n主办方请小扣回答出一个长度为 `N` 的数组,第 `i` 个元素(0 <= i < N)表示将 `0~i` 号计数器 **初始** 所示数字操作成满足所有条件 `nums[a]+1 == nums[a+1],(0 <= a < i)` 的最小操作数。回答正确方可进入秋日市集。\n\n由于答案可能很大,请将每个最小操作数对 `1,000,000,007` 取余。\n\n\n**示例 1:**\n>输入:`nums = [3,4,5,1,6,7]`\n>\n>输出:`[0,0,0,5,6,7]`\n>\n>解释:\n>i = 0,[3] 无需操作\n>i = 1,[3,4] 无需操作;\n>i = 2,[3,4,5] 无需操作;\n>i = 3,将 [3,4,5,1] 操作成 [3,4,5,6], 最少 5 次操作;\n>i = 4,将 [3,4,5,1,6] 操作成 [3,4,5,6,7], 最少 6 次操作;\n>i = 5,将 [3,4,5,1,6,7] 操作成 [3,4,5,6,7,8],最少 7 次操作;\n>返回 [0,0,0,5,6,7]。\n\n\n**示例 2:**\n>输入:`nums = [1,2,3,4,5]`\n>\n>输出:`[0,0,0,0,0]`\n>\n>解释:对于任意计数器编号 i 都无需操作。\n\n**示例 3:**\n>输入:`nums = [1,1,1,2,3,4]`\n>\n>输出:`[0,1,2,3,3,3]`\n>\n>解释:\n>i = 0,无需操作;\n>i = 1,将 [1,1] 操作成 [1,2] 或 [0,1] 最少 1 次操作;\n>i = 2,将 [1,1,1] 操作成 [1,2,3] 或 [0,1,2],最少 2 次操作;\n>i = 3,将 [1,1,1,2] 操作成 [1,2,3,4] 或 [0,1,2,3],最少 3 次操作;\n>i = 4,将 [1,1,1,2,3] 操作成 [-1,0,1,2,3],最少 3 次操作;\n>i = 5,将 [1,1,1,2,3,4] 操作成 [-1,0,1,2,3,4],最少 3 次操作;\n>返回 [0,1,2,3,3,3]。\n\n\n**提示:**\n- `1 <= nums.length <= 10^5`\n- `1 <= nums[i] <= 10^3`\n\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 22,
|
||||
"likes": 23,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"3.6K\", \"totalAcceptedRaw\": 1059, \"totalSubmissionRaw\": 3607, \"acRate\": \"29.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.1K\", \"totalSubmission\": \"3.7K\", \"totalAcceptedRaw\": 1116, \"totalSubmissionRaw\": 3700, \"acRate\": \"30.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/600YaG.json
Normal file
162
leetcode-cn/originData/600YaG.json
Normal file
File diff suppressed because one or more lines are too long
168
leetcode-cn/originData/6CE719.json
Normal file
168
leetcode-cn/originData/6CE719.json
Normal file
File diff suppressed because one or more lines are too long
162
leetcode-cn/originData/6UEx57.json
Normal file
162
leetcode-cn/originData/6UEx57.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个二叉树的根节点 <code>root</code> ,和一个整数 <code>targetSum</code> ,求该二叉树里节点值之和等于 <code>targetSum</code> 的 <strong>路径</strong> 的数目。</p>\n\n<p><strong>路径</strong> 不需要从根节点开始,也不需要在叶子节点结束,但是路径方向必须是向下的(只能从父节点到子节点)。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/04/09/pathsum3-1-tree.jpg\" style=\"width: 452px; \" /></p>\n\n<pre>\n<strong>输入:</strong>root = [10,5,-3,3,2,null,11,3,-2,null,1], targetSum = 8\n<strong>输出:</strong>3\n<strong>解释:</strong>和等于 8 的路径有 3 条,如图所示。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>root = [5,4,8,11,null,13,4,7,2,null,null,5,1], targetSum = 22\n<strong>输出:</strong>3\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>二叉树的节点个数的范围是 <code>[0,1000]</code></li>\n\t<li><meta charset=\"UTF-8\" /><code>-10<sup><span style=\"font-size: 9.449999809265137px;\">9</span></sup> <= Node.val <= 10<sup><span style=\"font-size: 9.449999809265137px;\">9</span></sup></code> </li>\n\t<li><code>-1000 <= targetSum <= 1000</code> </li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 437 题相同:<a href=\"https://leetcode-cn.com/problems/path-sum-iii/\">https://leetcode-cn.com/problems/path-sum-iii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 27,
|
||||
"likes": 33,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.9K\", \"totalSubmission\": \"14.8K\", \"totalAcceptedRaw\": 8950, \"totalSubmissionRaw\": 14774, \"acRate\": \"60.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.9K\", \"totalSubmission\": \"18.1K\", \"totalAcceptedRaw\": 10894, \"totalSubmissionRaw\": 18059, \"acRate\": \"60.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>树可以看成是一个连通且 <strong>无环 </strong>的 <strong>无向 </strong>图。</p>\n\n<p>给定往一棵 <code>n</code> 个节点 (节点值 <code>1~n</code>) 的树中添加一条边后的图。添加的边的两个顶点包含在 <code>1</code> 到 <code>n</code> 中间,且这条附加的边不属于树中已存在的边。图的信息记录于长度为 <code>n</code> 的二维数组 <code>edges</code> ,<code>edges[i] = [a<sub>i</sub>, b<sub>i</sub>]</code> 表示图中在 <code>ai</code> 和 <code>bi</code> 之间存在一条边。</p>\n\n<p>请找出一条可以删去的边,删除后可使得剩余部分是一个有着 <code>n</code> 个节点的树。如果有多个答案,则返回数组 <code>edges</code> 中最后出现的边。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626676174-hOEVUL-image.png\" style=\"width: 152px; \" /></p>\n\n<pre>\n<strong>输入:</strong> edges = [[1,2],[1,3],[2,3]]\n<strong>输出:</strong> [2,3]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626676179-kGxcmu-image.png\" style=\"width: 250px; \" /></p>\n\n<pre>\n<strong>输入:</strong> edges = [[1,2],[2,3],[3,4],[1,4],[1,5]]\n<strong>输出:</strong> [1,4]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == edges.length</code></li>\n\t<li><code>3 <= n <= 1000</code></li>\n\t<li><code>edges[i].length == 2</code></li>\n\t<li><code>1 <= ai < bi <= edges.length</code></li>\n\t<li><code>ai != bi</code></li>\n\t<li><code>edges</code> 中无重复元素</li>\n\t<li>给定的图是连通的 </li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 684 题相同: <a href=\"https://leetcode-cn.com/problems/redundant-connection/\">https://leetcode-cn.com/problems/redundant-connection/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 17,
|
||||
"likes": 23,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"3.5K\", \"totalSubmission\": \"5.1K\", \"totalAcceptedRaw\": 3524, \"totalSubmissionRaw\": 5090, \"acRate\": \"69.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"4.3K\", \"totalSubmission\": \"6.2K\", \"totalAcceptedRaw\": 4315, \"totalSubmissionRaw\": 6180, \"acRate\": \"69.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定链表的头结点 <code>head</code> ,请将其按 <strong>升序</strong> 排列并返回 <strong>排序后的链表</strong> 。</p>\n\n<ul>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/09/14/sort_list_1.jpg\" style=\"width: 302px; \" /></p>\n\n<pre>\n<b>输入:</b>head = [4,2,1,3]\n<b>输出:</b>[1,2,3,4]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/09/14/sort_list_2.jpg\" style=\"width: 402px; \" /></p>\n\n<pre>\n<b>输入:</b>head = [-1,5,3,4,0]\n<b>输出:</b>[-1,0,3,4,5]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<b>输入:</b>head = []\n<b>输出:</b>[]\n</pre>\n\n<p> </p>\n\n<p><b>提示:</b></p>\n\n<ul>\n\t<li>链表中节点的数目在范围 <code>[0, 5 * 10<sup>4</sup>]</code> 内</li>\n\t<li><code>-10<sup>5</sup> <= Node.val <= 10<sup>5</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><b>进阶:</b>你可以在 <code>O(n log n)</code> 时间复杂度和常数级空间复杂度下,对链表进行排序吗?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 148 题相同:<a href=\"https://leetcode-cn.com/problems/sort-list/\">https://leetcode-cn.com/problems/sort-list/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 43,
|
||||
"likes": 52,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -168,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"12.8K\", \"totalSubmission\": \"21K\", \"totalAcceptedRaw\": 12753, \"totalSubmissionRaw\": 20968, \"acRate\": \"60.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"15.6K\", \"totalSubmission\": \"25.8K\", \"totalAcceptedRaw\": 15647, \"totalSubmissionRaw\": 25795, \"acRate\": \"60.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个整数数组 <code>nums</code> 和两个整数 <code>k</code> 和 <code>t</code> 。请你判断是否存在 <b>两个不同下标</b> <code>i</code> 和 <code>j</code>,使得 <code>abs(nums[i] - nums[j]) <= t</code> ,同时又满足 <code>abs(i - j) <= k</code><em> </em>。</p>\n\n<p>如果存在则返回 <code>true</code>,不存在返回 <code>false</code>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3,1], k<em> </em>= 3, t = 0\n<strong>输出:</strong>true</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,0,1,1], k<em> </em>=<em> </em>1, t = 2\n<strong>输出:</strong>true</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,5,9,1,5,9], k = 2, t = 3\n<strong>输出:</strong>false</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 <= nums.length <= 2 * 10<sup>4</sup></code></li>\n\t<li><code>-2<sup>31</sup> <= nums[i] <= 2<sup>31</sup> - 1</code></li>\n\t<li><code>0 <= k <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= t <= 2<sup>31</sup> - 1</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 220 题相同: <a href=\"https://leetcode-cn.com/problems/contains-duplicate-iii/\">https://leetcode-cn.com/problems/contains-duplicate-iii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 33,
|
||||
"likes": 35,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -168,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.1K\", \"totalSubmission\": \"17.5K\", \"totalAcceptedRaw\": 6141, \"totalSubmissionRaw\": 17545, \"acRate\": \"35.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.6K\", \"totalSubmission\": \"21.7K\", \"totalAcceptedRaw\": 7552, \"totalSubmissionRaw\": 21737, \"acRate\": \"34.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个可包含重复数字的整数集合 <code>nums</code> ,<strong>按任意顺序</strong> 返回它所有不重复的全排列。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,1,2]\n<strong>输出:</strong>\n[[1,1,2],\n [1,2,1],\n [2,1,1]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3]\n<strong>输出:</strong>[[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2],[3,2,1]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 8</code></li>\n\t<li><code>-10 <= nums[i] <= 10</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 47 题相同: <a href=\"https://leetcode-cn.com/problems/permutations-ii/\">https://leetcode-cn.com/problems/permutations-ii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 15,
|
||||
"likes": 17,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.6K\", \"totalSubmission\": \"12.4K\", \"totalAcceptedRaw\": 8553, \"totalSubmissionRaw\": 12394, \"acRate\": \"69.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.1K\", \"totalSubmission\": \"14.6K\", \"totalAcceptedRaw\": 10072, \"totalSubmissionRaw\": 14560, \"acRate\": \"69.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"642\", \"totalSubmission\": \"1K\", \"totalAcceptedRaw\": 642, \"totalSubmissionRaw\": 1049, \"acRate\": \"61.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"739\", \"totalSubmission\": \"1.2K\", \"totalAcceptedRaw\": 739, \"totalSubmissionRaw\": 1163, \"acRate\": \"63.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>根据<a href=\"https://baike.baidu.com/item/%E9%80%86%E6%B3%A2%E5%85%B0%E5%BC%8F/128437\" target=\"_blank\"> 逆波兰表示法</a>,求该后缀表达式的计算结果。</p>\n\n<p>有效的算符包括 <code>+</code>、<code>-</code>、<code>*</code>、<code>/</code> 。每个运算对象可以是整数,也可以是另一个逆波兰表达式。</p>\n\n<p> </p>\n\n<p><strong>说明:</strong></p>\n\n<ul>\n\t<li>整数除法只保留整数部分。</li>\n\t<li>给定逆波兰表达式总是有效的。换句话说,表达式总会得出有效数值且不存在除数为 0 的情况。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>tokens = ["2","1","+","3","*"]\n<strong>输出:</strong>9\n<strong>解释:</strong>该算式转化为常见的中缀算术表达式为:((2 + 1) * 3) = 9\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>tokens = ["4","13","5","/","+"]\n<strong>输出:</strong>6\n<strong>解释:</strong>该算式转化为常见的中缀算术表达式为:(4 + (13 / 5)) = 6\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>tokens = ["10","6","9","3","+","-11","*","/","*","17","+","5","+"]\n<strong>输出:</strong>22\n<strong>解释:</strong>\n该算式转化为常见的中缀算术表达式为:\n ((10 * (6 / ((9 + 3) * -11))) + 17) + 5\n= ((10 * (6 / (12 * -11))) + 17) + 5\n= ((10 * (6 / -132)) + 17) + 5\n= ((10 * 0) + 17) + 5\n= (0 + 17) + 5\n= 17 + 5\n= 22</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= tokens.length <= 10<sup>4</sup></code></li>\n\t<li><code>tokens[i]</code> 要么是一个算符(<code>"+"</code>、<code>"-"</code>、<code>"*"</code> 或 <code>"/"</code>),要么是一个在范围 <code>[-200, 200]</code> 内的整数</li>\n</ul>\n\n<p> </p>\n\n<p><strong>逆波兰表达式:</strong></p>\n\n<p>逆波兰表达式是一种后缀表达式,所谓后缀就是指算符写在后面。</p>\n\n<ul>\n\t<li>平常使用的算式则是一种中缀表达式,如 <code>( 1 + 2 ) * ( 3 + 4 )</code> 。</li>\n\t<li>该算式的逆波兰表达式写法为 <code>( ( 1 2 + ) ( 3 4 + ) * )</code> 。</li>\n</ul>\n\n<p>逆波兰表达式主要有以下两个优点:</p>\n\n<ul>\n\t<li>去掉括号后表达式无歧义,上式即便写成 <code>1 2 + 3 4 + * </code>也可以依据次序计算出正确结果。</li>\n\t<li>适合用栈操作运算:遇到数字则入栈;遇到算符则取出栈顶两个数字进行计算,并将结果压入栈中。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 150 题相同: <a href=\"https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/\">https://leetcode-cn.com/problems/evaluate-reverse-polish-notation/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 15,
|
||||
"likes": 17,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"18K\", \"totalAcceptedRaw\": 10164, \"totalSubmissionRaw\": 17964, \"acRate\": \"56.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.3K\", \"totalSubmission\": \"21.8K\", \"totalAcceptedRaw\": 12261, \"totalSubmissionRaw\": 21762, \"acRate\": \"56.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -9,10 +9,10 @@
|
||||
"titleSlug": "A1NYOS",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>\n",
|
||||
"translatedTitle": "0 和 1 个数相同的子数组",
|
||||
"translatedContent": "<p>给定一个二进制数组 <code>nums</code> , 找到含有相同数量的 <code>0</code> 和 <code>1</code> 的最长连续子数组,并返回该子数组的长度。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [0,1]\n<strong>输出:</strong> 2\n<strong>说明:</strong> [0, 1] 是具有相同数量 0 和 1 的最长连续子数组。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [0,1,0]\n<strong>输出:</strong> 2\n<strong>说明:</strong> [0, 1] (或 [1, 0]) 是具有相同数量 0 和 1 的最长连续子数组。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>nums[i]</code> 不是 <code>0</code> 就是 <code>1</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 525 题相同: <a href=\"https://leetcode-cn.com/problems/contiguous-array/\">https://leetcode-cn.com/problems/contiguous-array/</a></p>\n",
|
||||
"translatedContent": "<p>给定一个二进制数组 <code>nums</code> , 找到含有相同数量的 <code>0</code> 和 <code>1</code> 的最长连续子数组,并返回该子数组的长度。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [0,1]\n<strong>输出:</strong> 2\n<strong>说明:</strong> [0, 1] 是具有相同数量 0 和 1 的最长连续子数组。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [0,1,0]\n<strong>输出:</strong> 2\n<strong>说明:</strong> [0, 1] (或 [1, 0]) 是具有相同数量 0 和 1 的最长连续子数组。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>5</sup></code></li>\n\t<li><code>nums[i]</code> 不是 <code>0</code> 就是 <code>1</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 525 题相同: <a href=\"https://leetcode-cn.com/problems/contiguous-array/\">https://leetcode-cn.com/problems/contiguous-array/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 48,
|
||||
"likes": 62,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"15K\", \"totalSubmission\": \"26.7K\", \"totalAcceptedRaw\": 14964, \"totalSubmissionRaw\": 26713, \"acRate\": \"56.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"17.8K\", \"totalSubmission\": \"32K\", \"totalAcceptedRaw\": 17817, \"totalSubmissionRaw\": 31960, \"acRate\": \"55.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -185,7 +185,7 @@
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "",
|
||||
"exampleTestcases": "[0,1]\n[0,1,0]",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>符合下列属性的数组 <code>arr</code> 称为 <strong>山峰数组</strong>(<strong>山脉数组)</strong> :</p>\n\n<ul>\n\t<li><code>arr.length >= 3</code></li>\n\t<li>存在 <code>i</code>(<code>0 < i < arr.length - 1</code>)使得:\n\t<ul>\n\t\t<li><code>arr[0] < arr[1] < ... arr[i-1] < arr[i] </code></li>\n\t\t<li><code>arr[i] > arr[i+1] > ... > arr[arr.length - 1]</code></li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>给定由整数组成的山峰数组 <code>arr</code> ,返回任何满足 <code>arr[0] < arr[1] < ... arr[i - 1] < arr[i] > arr[i + 1] > ... > arr[arr.length - 1]</code> 的下标 <code>i</code> ,即山峰顶部。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [0,1,0]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [1,3,5,4,2]\n<strong>输出:2</strong>\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [0,10,5,2]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [3,4,5,1]\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre>\n<strong>输入:</strong>arr = [24,69,100,99,79,78,67,36,26,19]\n<strong>输出:</strong>2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= arr.length <= 10<sup>4</sup></code></li>\n\t<li><code>0 <= arr[i] <= 10<sup>6</sup></code></li>\n\t<li>题目数据保证 <code>arr</code> 是一个山脉数组</li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>很容易想到时间复杂度 <code>O(n)</code> 的解决方案,你可以设计一个 <code>O(log(n))</code> 的解决方案吗?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 852 题相同:<a href=\"https://leetcode-cn.com/problems/peak-index-in-a-mountain-array/\">https://leetcode-cn.com/problems/peak-index-in-a-mountain-array/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 76,
|
||||
"likes": 80,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"44.2K\", \"totalSubmission\": \"61.8K\", \"totalAcceptedRaw\": 44171, \"totalSubmissionRaw\": 61849, \"acRate\": \"71.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"46.5K\", \"totalSubmission\": \"65.3K\", \"totalAcceptedRaw\": 46496, \"totalSubmissionRaw\": 65320, \"acRate\": \"71.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个由 <strong>不同</strong> 正整数组成的数组 <code>nums</code> ,和一个目标整数 <code>target</code> 。请从 <code>nums</code> 中找出并返回总和为 <code>target</code> 的元素组合的个数。数组中的数字可以在一次排列中出现任意次,但是顺序不同的序列被视作不同的组合。</p>\n\n<p>题目数据保证答案符合 32 位整数范围。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3], target = 4\n<strong>输出:</strong>7\n<strong>解释:</strong>\n所有可能的组合为:\n(1, 1, 1, 1)\n(1, 1, 2)\n(1, 2, 1)\n(1, 3)\n(2, 1, 1)\n(2, 2)\n(3, 1)\n请注意,顺序不同的序列被视作不同的组合。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [9], target = 3\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 200</code></li>\n\t<li><code>1 <= nums[i] <= 1000</code></li>\n\t<li><code>nums</code> 中的所有元素 <strong>互不相同</strong></li>\n\t<li><code>1 <= target <= 1000</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>如果给定的数组中含有负数会发生什么?问题会产生何种变化?如果允许负数出现,需要向题目中添加哪些限制条件?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 377 题相同:<a href=\"https://leetcode-cn.com/problems/combination-sum-iv/\">https://leetcode-cn.com/problems/combination-sum-iv/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 20,
|
||||
"likes": 22,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"7.8K\", \"totalAcceptedRaw\": 4620, \"totalSubmissionRaw\": 7800, \"acRate\": \"59.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.6K\", \"totalSubmission\": \"9.5K\", \"totalAcceptedRaw\": 5578, \"totalSubmissionRaw\": 9490, \"acRate\": \"58.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
168
leetcode-cn/originData/D9PW8w.json
Normal file
168
leetcode-cn/originData/D9PW8w.json
Normal file
File diff suppressed because one or more lines are too long
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.6K\", \"totalSubmission\": \"3.5K\", \"totalAcceptedRaw\": 1560, \"totalSubmissionRaw\": 3528, \"acRate\": \"44.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.7K\", \"totalSubmission\": \"3.8K\", \"totalAcceptedRaw\": 1731, \"totalSubmissionRaw\": 3757, \"acRate\": \"46.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "某解密游戏中,有一个 N\\*M 的迷宫,迷宫地形会随时间变化而改变,迷宫出口一直位于 `(n-1,m-1)` 位置。迷宫变化规律记录于 `maze` 中,`maze[i]` 表示 `i` 时刻迷宫的地形状态,`\".\"` 表示可通行空地,`\"#\"` 表示陷阱。\n\n地形图初始状态记作 `maze[0]`,此时小力位于起点 `(0,0)`。此后每一时刻可选择往上、下、左、右其一方向走一步,或者停留在原地。\n\n小力背包有以下两个魔法卷轴(卷轴使用一次后消失):\n+ 临时消除术:将指定位置在下一个时刻变为空地;\n+ 永久消除术:将指定位置永久变为空地。\n\n请判断在迷宫变化结束前(含最后时刻),小力能否在不经过任意陷阱的情况下到达迷宫出口呢?\n\n**注意: 输入数据保证起点和终点在所有时刻均为空地。**\n\n**示例 1:**\n>输入:`maze = [[\".#.\",\"#..\"],[\"...\",\".#.\"],[\".##\",\".#.\"],[\"..#\",\".#.\"]]`\n>\n>输出:`true`\n>\n>解释:\n\n\n\n**示例 2:**\n>输入:`maze = [[\".#.\",\"...\"],[\"...\",\"...\"]]`\n>\n>输出:`false`\n>\n>解释:由于时间不够,小力无法到达终点逃出迷宫。\n\n**示例 3:**\n>输入:`maze = [[\"...\",\"...\",\"...\"],[\".##\",\"###\",\"##.\"],[\".##\",\"###\",\"##.\"],[\".##\",\"###\",\"##.\"],[\".##\",\"###\",\"##.\"],[\".##\",\"###\",\"##.\"],[\".##\",\"###\",\"##.\"]]`\n>\n>输出:`false`\n>\n>解释:由于道路不通,小力无法到达终点逃出迷宫。\n\n**提示:**\n- `1 <= maze.length <= 100`\n- `1 <= maze[i].length, maze[i][j].length <= 50`\n- `maze[i][j]` 仅包含 `\".\"`、`\"#\"`",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 27,
|
||||
"likes": 28,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -161,7 +161,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.1K\", \"totalSubmission\": \"7.9K\", \"totalAcceptedRaw\": 2147, \"totalSubmissionRaw\": 7925, \"acRate\": \"27.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"2.3K\", \"totalSubmission\": \"8.3K\", \"totalAcceptedRaw\": 2331, \"totalSubmissionRaw\": 8266, \"acRate\": \"28.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/De4qBB.json
Normal file
162
leetcode-cn/originData/De4qBB.json
Normal file
File diff suppressed because one or more lines are too long
162
leetcode-cn/originData/EJvmW4.json
Normal file
162
leetcode-cn/originData/EJvmW4.json
Normal file
File diff suppressed because one or more lines are too long
150
leetcode-cn/originData/EXvqDp.json
Normal file
150
leetcode-cn/originData/EXvqDp.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>设计一个支持在<em>平均 </em>时间复杂度 <strong>O(1)</strong> 下,执行以下操作的数据结构:</p>\n\n<ul>\n\t<li><code>insert(val)</code>:当元素 <code>val</code> 不存在时返回 <code>true</code> ,并向集合中插入该项,否则返回 <code>false</code> 。</li>\n\t<li><code>remove(val)</code>:当元素 <code>val</code> 存在时返回 <code>true</code> ,并从集合中移除该项,否则返回 <code>false</code> 。</li>\n\t<li><code>getRandom</code>:随机返回现有集合中的一项。每个元素应该有 <strong>相同的概率 </strong>被返回。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 :</strong></p>\n\n<pre>\n<strong>输入: </strong>inputs = ["RandomizedSet", "insert", "remove", "insert", "getRandom", "remove", "insert", "getRandom"]\n[[], [1], [2], [2], [], [1], [2], []]\n<strong>输出: </strong>[null, true, false, true, 2, true, false, 2]\n<strong>解释:\n</strong>RandomizedSet randomSet = new RandomizedSet(); // 初始化一个空的集合\nrandomSet.insert(1); // 向集合中插入 1 , 返回 true 表示 1 被成功地插入\n\nrandomSet.remove(2); // 返回 false,表示集合中不存在 2 \n\nrandomSet.insert(2); // 向集合中插入 2 返回 true ,集合现在包含 [1,2] \n\nrandomSet.getRandom(); // getRandom 应随机返回 1 或 2 \n \nrandomSet.remove(1); // 从集合中移除 1 返回 true 。集合现在包含 [2] \n\nrandomSet.insert(2); // 2 已在集合中,所以返回 false \n\nrandomSet.getRandom(); // 由于 2 是集合中唯一的数字,getRandom 总是返回 2 \n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong><meta charset=\"UTF-8\" /></p>\n\n<ul>\n\t<li><code>-2<sup>31</sup> <= val <= 2<sup>31</sup> - 1</code></li>\n\t<li>最多进行<code> 2 * 10<sup>5</sup></code> 次 <code>insert</code> , <code>remove</code> 和 <code>getRandom</code> 方法调用</li>\n\t<li>当调用 <code>getRandom</code> 方法时,集合中至少有一个元素</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 380 题相同:<a href=\"https://leetcode-cn.com/problems/insert-delete-getrandom-o1/\">https://leetcode-cn.com/problems/insert-delete-getrandom-o1/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 24,
|
||||
"likes": 31,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -168,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.5K\", \"totalSubmission\": \"15.7K\", \"totalAcceptedRaw\": 8547, \"totalSubmissionRaw\": 15725, \"acRate\": \"54.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"18.8K\", \"totalAcceptedRaw\": 10227, \"totalSubmissionRaw\": 18817, \"acRate\": \"54.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>一个专业的小偷,计划偷窃沿街的房屋。每间房内都藏有一定的现金,影响小偷偷窃的唯一制约因素就是相邻的房屋装有相互连通的防盗系统,<strong>如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警</strong>。</p>\n\n<p>给定一个代表每个房屋存放金额的非负整数数组 <code>nums</code> ,请计算<strong> 不触动警报装置的情况下 </strong>,一夜之内能够偷窃到的最高金额。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums =<strong> </strong>[1,2,3,1]\n<strong>输出:</strong>4\n<strong>解释:</strong>偷窃 1 号房屋 (金额 = 1) ,然后偷窃 3 号房屋 (金额 = 3)。\n 偷窃到的最高金额 = 1 + 3 = 4 。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums =<strong> </strong>[2,7,9,3,1]\n<strong>输出:</strong>12\n<strong>解释:</strong>偷窃 1 号房屋 (金额 = 2), 偷窃 3 号房屋 (金额 = 9),接着偷窃 5 号房屋 (金额 = 1)。\n 偷窃到的最高金额 = 2 + 9 + 1 = 12 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 100</code></li>\n\t<li><code>0 <= nums[i] <= 400</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 198 题相同: <a href=\"https://leetcode-cn.com/problems/house-robber/\">https://leetcode-cn.com/problems/house-robber/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 15,
|
||||
"likes": 18,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.1K\", \"totalSubmission\": \"14.9K\", \"totalAcceptedRaw\": 9111, \"totalSubmissionRaw\": 14881, \"acRate\": \"61.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.8K\", \"totalSubmission\": \"17.7K\", \"totalAcceptedRaw\": 10769, \"totalSubmissionRaw\": 17661, \"acRate\": \"61.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>数组的每个下标作为一个阶梯,第 <code>i</code> 个阶梯对应着一个非负数的体力花费值 <code>cost[i]</code>(下标从 <code>0</code> 开始)。</p>\n\n<p>每当爬上一个阶梯都要花费对应的体力值,一旦支付了相应的体力值,就可以选择向上爬一个阶梯或者爬两个阶梯。</p>\n\n<p>请找出达到楼层顶部的最低花费。在开始时,你可以选择从下标为 0 或 1 的元素作为初始阶梯。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>cost = [10, 15, 20]\n<strong>输出:</strong>15\n<strong>解释:</strong>最低花费是从 cost[1] 开始,然后走两步即可到阶梯顶,一共花费 15 。\n</pre>\n\n<p><strong> 示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>cost = [1, 100, 1, 1, 1, 100, 1, 1, 100, 1]\n<strong>输出:</strong>6\n<strong>解释:</strong>最低花费方式是从 cost[0] 开始,逐个经过那些 1 ,跳过 cost[3] ,一共花费 6 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>2 <= cost.length <= 1000</code></li>\n\t<li><code>0 <= cost[i] <= 999</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 746 题相同: <a href=\"https://leetcode-cn.com/problems/min-cost-climbing-stairs/\">https://leetcode-cn.com/problems/min-cost-climbing-stairs/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 34,
|
||||
"likes": 37,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"13K\", \"totalSubmission\": \"17.6K\", \"totalAcceptedRaw\": 13033, \"totalSubmissionRaw\": 17648, \"acRate\": \"73.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"15.4K\", \"totalSubmission\": \"20.9K\", \"totalAcceptedRaw\": 15443, \"totalSubmissionRaw\": 20903, \"acRate\": \"73.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -7,12 +7,12 @@
|
||||
"boundTopicId": 910311,
|
||||
"title": "相似的字符串",
|
||||
"titleSlug": "H6lPxb",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>\n",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>",
|
||||
"translatedTitle": "相似的字符串",
|
||||
"translatedContent": "<p>如果交换字符串 <code>X</code> 中的两个不同位置的字母,使得它和字符串 <code>Y</code> 相等,那么称 <code>X</code> 和 <code>Y</code> 两个字符串相似。如果这两个字符串本身是相等的,那它们也是相似的。</p>\n\n<p>例如,<code>"tars"</code> 和 <code>"rats"</code> 是相似的 (交换 <code>0</code> 与 <code>2</code> 的位置); <code>"rats"</code> 和 <code>"arts"</code> 也是相似的,但是 <code>"star"</code> 不与 <code>"tars"</code>,<code>"rats"</code>,或 <code>"arts"</code> 相似。</p>\n\n<p>总之,它们通过相似性形成了两个关联组:<code>{"tars", "rats", "arts"}</code> 和 <code>{"star"}</code>。注意,<code>"tars"</code> 和 <code>"arts"</code> 是在同一组中,即使它们并不相似。形式上,对每个组而言,要确定一个单词在组中,只需要这个词和该组中至少一个单词相似。</p>\n\n<p>给定一个字符串列表 <code>strs</code>。列表中的每个字符串都是 <code>strs</code> 中其它所有字符串的一个 <strong>字母异位词 </strong>。请问 <code>strs</code> 中有多少个相似字符串组?</p>\n\n<p><strong>字母异位词(anagram)</strong>,一种把某个字符串的字母的位置(顺序)加以改换所形成的新词。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>strs = ["tars","rats","arts","star"]\n<strong>输出:</strong>2\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>strs = ["omv","ovm"]\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= strs.length <= 300</code></li>\n\t<li><code>1 <= strs[i].length <= 300</code></li>\n\t<li><code>strs[i]</code> 只包含小写字母。</li>\n\t<li><code>strs</code> 中的所有单词都具有相同的长度,且是彼此的字母异位词。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 839 题相同:<a href=\"https://leetcode-cn.com/problems/similar-string-groups/\">https://leetcode-cn.com/problems/similar-string-groups/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 9,
|
||||
"likes": 10,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -44,6 +44,12 @@
|
||||
"translatedName": "并查集",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "Array",
|
||||
"slug": "array",
|
||||
"translatedName": "数组",
|
||||
"__typename": "TopicTagNode"
|
||||
},
|
||||
{
|
||||
"name": "String",
|
||||
"slug": "string",
|
||||
@@ -162,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.9K\", \"totalSubmission\": \"4.5K\", \"totalAcceptedRaw\": 2852, \"totalSubmissionRaw\": 4499, \"acRate\": \"63.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.5K\", \"totalSubmission\": \"5.6K\", \"totalAcceptedRaw\": 3544, \"totalSubmissionRaw\": 5641, \"acRate\": \"62.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>写一个 <code>RecentCounter</code> 类来计算特定时间范围内最近的请求。</p>\n\n<p>请实现 <code>RecentCounter</code> 类:</p>\n\n<ul>\n\t<li><code>RecentCounter()</code> 初始化计数器,请求数为 0 。</li>\n\t<li><code>int ping(int t)</code> 在时间 <code>t</code> 添加一个新请求,其中 <code>t</code> 表示以毫秒为单位的某个时间,并返回过去 <code>3000</code> 毫秒内发生的所有请求数(包括新请求)。确切地说,返回在 <code>[t-3000, t]</code> 内发生的请求数。</li>\n</ul>\n\n<p><strong>保证</strong> 每次对 <code>ping</code> 的调用都使用比之前更大的 <code>t</code> 值。</p>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入:</strong>\ninputs = ["RecentCounter", "ping", "ping", "ping", "ping"]\ninputs = [[], [1], [100], [3001], [3002]]\n<strong>输出:</strong>\n[null, 1, 2, 3, 3]\n\n<strong>解释:</strong>\nRecentCounter recentCounter = new RecentCounter();\nrecentCounter.ping(1); // requests = [<strong>1</strong>],范围是 [-2999,1],返回 1\nrecentCounter.ping(100); // requests = [<strong>1</strong>, <strong>100</strong>],范围是 [-2900,100],返回 2\nrecentCounter.ping(3001); // requests = [<strong>1</strong>, <strong>100</strong>, <strong>3001</strong>],范围是 [1,3001],返回 3\nrecentCounter.ping(3002); // requests = [1, <strong>100</strong>, <strong>3001</strong>, <strong>3002</strong>],范围是 [2,3002],返回 3\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= t <= 10<sup>9</sup></code></li>\n\t<li>保证每次对 <code>ping</code> 调用所使用的 <code>t</code> 值都 <strong>严格递增</strong></li>\n\t<li>至多调用 <code>ping</code> 方法 <code>10<sup>4</sup></code> 次</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 933 题相同: <a href=\"https://leetcode-cn.com/problems/number-of-recent-calls/\">https://leetcode-cn.com/problems/number-of-recent-calls/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 14,
|
||||
"likes": 19,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.9K\", \"totalSubmission\": \"11.9K\", \"totalAcceptedRaw\": 9874, \"totalSubmissionRaw\": 11862, \"acRate\": \"83.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11.8K\", \"totalSubmission\": \"14.2K\", \"totalAcceptedRaw\": 11769, \"totalSubmissionRaw\": 14209, \"acRate\": \"82.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>正整数 <code>n</code> 代表生成括号的对数,请设计一个函数,用于能够生成所有可能的并且 <strong>有效的 </strong>括号组合。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 3\n<strong>输出:</strong>["((()))","(()())","(())()","()(())","()()()"]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>["()"]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 8</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 22 题相同: <a href=\"https://leetcode-cn.com/problems/generate-parentheses/\">https://leetcode-cn.com/problems/generate-parentheses/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 25,
|
||||
"likes": 27,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"11.9K\", \"totalAcceptedRaw\": 10184, \"totalSubmissionRaw\": 11913, \"acRate\": \"85.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12K\", \"totalSubmission\": \"14.1K\", \"totalAcceptedRaw\": 12018, \"totalSubmissionRaw\": 14097, \"acRate\": \"85.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"4.1K\", \"totalAcceptedRaw\": 1351, \"totalSubmissionRaw\": 4079, \"acRate\": \"33.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.4K\", \"totalSubmission\": \"4.2K\", \"totalAcceptedRaw\": 1416, \"totalSubmissionRaw\": 4192, \"acRate\": \"33.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5K\", \"totalSubmission\": \"10.6K\", \"totalAcceptedRaw\": 5005, \"totalSubmissionRaw\": 10594, \"acRate\": \"47.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"6.1K\", \"totalSubmission\": \"12.8K\", \"totalAcceptedRaw\": 6054, \"totalSubmissionRaw\": 12791, \"acRate\": \"47.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个三角形 <code>triangle</code> ,找出自顶向下的最小路径和。</p>\n\n<p>每一步只能移动到下一行中相邻的结点上。<strong>相邻的结点 </strong>在这里指的是 <strong>下标</strong> 与 <strong>上一层结点下标</strong> 相同或者等于 <strong>上一层结点下标 + 1</strong> 的两个结点。也就是说,如果正位于当前行的下标 <code>i</code> ,那么下一步可以移动到下一行的下标 <code>i</code> 或 <code>i + 1</code> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>triangle = [[2],[3,4],[6,5,7],[4,1,8,3]]\n<strong>输出:</strong>11\n<strong>解释:</strong>如下面简图所示:\n <strong>2</strong>\n <strong>3</strong> 4\n 6 <strong>5</strong> 7\n4 <strong>1</strong> 8 3\n自顶向下的最小路径和为 11(即,2 + 3 + 5 + 1 = 11)。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>triangle = [[-10]]\n<strong>输出:</strong>-10\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= triangle.length <= 200</code></li>\n\t<li><code>triangle[0].length == 1</code></li>\n\t<li><code>triangle[i].length == triangle[i - 1].length + 1</code></li>\n\t<li><code>-10<sup>4</sup> <= triangle[i][j] <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong></p>\n\n<ul>\n\t<li>你可以只使用 <code>O(n)</code> 的额外空间(<code>n</code> 为三角形的总行数)来解决这个问题吗?</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 120 题相同: <a href=\"https://leetcode-cn.com/problems/triangle/\">https://leetcode-cn.com/problems/triangle/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 9,
|
||||
"likes": 12,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.8K\", \"totalSubmission\": \"9K\", \"totalAcceptedRaw\": 6814, \"totalSubmissionRaw\": 8974, \"acRate\": \"75.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"8.2K\", \"totalSubmission\": \"10.8K\", \"totalAcceptedRaw\": 8245, \"totalSubmissionRaw\": 10834, \"acRate\": \"76.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>假如有一排房子,共 <code>n</code> 个,每个房子可以被粉刷成红色、蓝色或者绿色这三种颜色中的一种,你需要粉刷所有的房子并且使其相邻的两个房子颜色不能相同。</p>\n\n<p>当然,因为市场上不同颜色油漆的价格不同,所以房子粉刷成不同颜色的花费成本也是不同的。每个房子粉刷成不同颜色的花费是以一个 <code>n x 3</code><em> </em>的正整数矩阵 <code>costs</code> 来表示的。</p>\n\n<p>例如,<code>costs[0][0]</code> 表示第 0 号房子粉刷成红色的成本花费;<code>costs[1][2]</code> 表示第 1 号房子粉刷成绿色的花费,以此类推。</p>\n\n<p>请计算出粉刷完所有房子最少的花费成本。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入: </strong>costs = [[17,2,17],[16,16,5],[14,3,19]]\n<strong>输出: </strong>10\n<strong>解释: </strong>将 0 号房子粉刷成蓝色,1 号房子粉刷成绿色,2 号房子粉刷成蓝色<strong>。</strong>\n 最少花费: 2 + 5 + 3 = 10。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入: </strong>costs = [[7,6,2]]\n<strong>输出: 2</strong>\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>costs.length == n</code></li>\n\t<li><code>costs[i].length == 3</code></li>\n\t<li><code>1 <= n <= 100</code></li>\n\t<li><code>1 <= costs[i][j] <= 20</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 256 题相同:<a href=\"https://leetcode-cn.com/problems/paint-house/\">https://leetcode-cn.com/problems/paint-house/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 29,
|
||||
"likes": 33,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.6K\", \"totalSubmission\": \"9.9K\", \"totalAcceptedRaw\": 7644, \"totalSubmissionRaw\": 9856, \"acRate\": \"77.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.2K\", \"totalSubmission\": \"11.9K\", \"totalAcceptedRaw\": 9221, \"totalSubmissionRaw\": 11941, \"acRate\": \"77.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定两个 01 字符串 <code>a</code> 和 <code>b</code> ,请计算它们的和,并以二进制字符串的形式输出。</p>\n\n<p>输入为 <strong>非空 </strong>字符串且只包含数字 <code>1</code> 和 <code>0</code>。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> a = "11", b = "10"\n<strong>输出:</strong> "101"</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> a = "1010", b = "1011"\n<strong>输出:</strong> "10101"</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个字符串仅由字符 <code>'0'</code> 或 <code>'1'</code> 组成。</li>\n\t<li><code>1 <= a.length, b.length <= 10^4</code></li>\n\t<li>字符串如果不是 <code>"0"</code> ,就都不含前导零。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 67 题相同:<a href=\"https://leetcode-cn.com/problems/add-binary/\">https://leetcode-cn.com/problems/add-binary/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 26,
|
||||
"likes": 30,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"24.5K\", \"totalSubmission\": \"44K\", \"totalAcceptedRaw\": 24495, \"totalSubmissionRaw\": 43978, \"acRate\": \"55.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"28.2K\", \"totalSubmission\": \"50.9K\", \"totalAcceptedRaw\": 28168, \"totalSubmissionRaw\": 50877, \"acRate\": \"55.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>现有一种使用英语字母的外星文语言,这门语言的字母顺序与英语顺序不同。</p>\n\n<p>给定一个字符串列表 <code>words</code> ,作为这门语言的词典,<code>words</code> 中的字符串已经 <strong>按这门新语言的字母顺序进行了排序</strong> 。</p>\n\n<p>请你根据该词典还原出此语言中已知的字母顺序,并 <strong>按字母递增顺序</strong> 排列。若不存在合法字母顺序,返回 <code>""</code> 。若存在多种可能的合法字母顺序,返回其中 <strong>任意一种</strong> 顺序即可。</p>\n\n<p>字符串 <code>s</code> <strong>字典顺序小于</strong> 字符串 <code>t</code> 有两种情况:</p>\n\n<ul>\n\t<li>在第一个不同字母处,如果 <code>s</code> 中的字母在这门外星语言的字母顺序中位于 <code>t</code> 中字母之前,那么 <code>s</code> 的字典顺序小于 <code>t</code> 。</li>\n\t<li>如果前面 <code>min(s.length, t.length)</code> 字母都相同,那么 <code>s.length < t.length</code> 时,<code>s</code> 的字典顺序也小于 <code>t</code> 。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>words = ["wrt","wrf","er","ett","rftt"]\n<strong>输出:</strong>"wertf"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>words = ["z","x"]\n<strong>输出:</strong>"zx"\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>words = ["z","x","z"]\n<strong>输出:</strong>""\n<strong>解释:</strong>不存在合法字母顺序,因此返回 <code>"" 。</code>\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= words.length <= 100</code></li>\n\t<li><code>1 <= words[i].length <= 100</code></li>\n\t<li><code>words[i]</code> 仅由小写英文字母组成</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 269 题相同: <a href=\"https://leetcode-cn.com/problems/alien-dictionary/\">https://leetcode-cn.com/problems/alien-dictionary/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 12,
|
||||
"likes": 17,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -174,7 +174,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"2.4K\", \"totalSubmission\": \"5.8K\", \"totalAcceptedRaw\": 2429, \"totalSubmissionRaw\": 5801, \"acRate\": \"41.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"2.9K\", \"totalSubmission\": \"7K\", \"totalAcceptedRaw\": 2941, \"totalSubmissionRaw\": 6969, \"acRate\": \"42.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "小扣打算给自己的 **VS code** 安装使用插件,初始状态下带宽每分钟可以完成 `1` 个插件的下载。假定每分钟选择以下两种策略之一:\r\n- 使用当前带宽下载插件\r\n- 将带宽加倍(下载插件数量随之加倍)\r\n\r\n请返回小扣完成下载 `n` 个插件最少需要多少分钟。\r\n\r\n注意:实际的下载的插件数量可以超过 `n` 个\r\n\r\n\r\n**示例 1:**\r\n>输入:`n = 2`\r\n>\r\n>输出:`2`\r\n>\r\n>解释:\r\n> 以下两个方案,都能实现 2 分钟内下载 2 个插件\r\n>- 方案一:第一分钟带宽加倍,带宽可每分钟下载 2 个插件;第二分钟下载 2 个插件\r\n>- 方案二:第一分钟下载 1 个插件,第二分钟下载 1 个插件\r\n\r\n**示例 2:**\r\n>输入:`n = 4`\r\n>\r\n>输出:`3`\r\n>\r\n>解释:\r\n> 最少需要 3 分钟可完成 4 个插件的下载,以下是其中一种方案:\r\n> 第一分钟带宽加倍,带宽可每分钟下载 2 个插件;\r\n> 第二分钟下载 2 个插件;\r\n> 第三分钟下载 2 个插件。\r\n\r\n\r\n\r\n**提示:**\r\n- `1 <= n <= 10^5`\r\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 23,
|
||||
"likes": 24,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.2K\", \"totalSubmission\": \"13.3K\", \"totalAcceptedRaw\": 7227, \"totalSubmissionRaw\": 13253, \"acRate\": \"54.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.9K\", \"totalSubmission\": \"14.5K\", \"totalAcceptedRaw\": 7906, \"totalSubmissionRaw\": 14477, \"acRate\": \"54.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "「力扣挑战赛」中有一个由 `N` 个关卡组成的**环形**闯关游戏,关卡编号为 `0`~`N-1`,编号 `0` 的关卡和编号 `N-1` 的关卡相邻。每个关卡均有积分要求,`challenge[i]` 表示挑战编号 `i` 的关卡最少需要拥有的积分。\n{:width=\"240px\"}\n\n\n小扣想要挑战关卡,闯关的具体规则如下:\n\n- 初始小扣可以指定其中一个关卡为「开启」状态,其余关卡将处于「未开启」状态。\n- 小扣可以挑战处于「开启」状态且**满足最少积分要求**的关卡,若小扣挑战该关卡前积分为 `score`,挑战结束后,积分将增长为 `score|challenge[i]`(即位运算中的 `\"OR\"` 运算)\n- 在挑战某个关卡后,该关卡两侧相邻的关卡将会开启(若之前未开启)\n\n请帮助小扣进行计算,初始最少需要多少积分,可以挑战 **环形闯关游戏** 的所有关卡。\n\n**示例1:**\n\n> 输入:`challenge = [5,4,6,2,7]`\n>\n> 输出:`4`\n> \n> 解释: 初始选择编号 3 的关卡开启,积分为 4\n>挑战编号 3 的关卡,积分变为 $4 | 2 = 6$,开启 2、4 处的关卡\n>挑战编号 2 的关卡,积分变为 $6 | 6 = 6$,开启 1 处的关卡\n>挑战编号 1 的关卡,积分变为 $6 | 4 = 6$,开启 0 处的关卡\n>挑战编号 0 的关卡,积分变为 $6 | 5 = 7$\n>挑战编号 4 的关卡,顺利完成全部的关卡\n\n\n**示例2:**\n\n> 输入:`challenge = [12,7,11,3,9]`\n>\n> 输出:`8`\n>\n> 解释: 初始选择编号 3 的关卡开启,积分为 8\n>挑战编号 3 的关卡,积分变为 $8 | 3 = 11$,开启 2、4 处的关卡\n>挑战编号 2 的关卡,积分变为 $11 | 11 = 11$,开启 1 处的关卡\n>挑战编号 4 的关卡,积分变为 $11 | 9 = 11$,开启 0 处的关卡\n>挑战编号 1 的关卡,积分变为 $11 | 7 = 15$\n>挑战编号 0 的关卡,顺利完成全部的关卡\n\n**示例3:**\n\n> 输入:`challenge = [1,1,1]`\n>\n> 输出:`1`\n\n**提示:** \n- `1 <= challenge.length <= 5*10^4`\n- `1 <= challenge[i] <= 10^18`",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 5,
|
||||
"likes": 6,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"465\", \"totalSubmission\": \"1.7K\", \"totalAcceptedRaw\": 465, \"totalSubmissionRaw\": 1711, \"acRate\": \"27.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"555\", \"totalSubmission\": \"1.9K\", \"totalAcceptedRaw\": 555, \"totalSubmissionRaw\": 1921, \"acRate\": \"28.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/KnLfVT.json
Normal file
162
leetcode-cn/originData/KnLfVT.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个单链表 <code>L</code><em> </em>的头节点 <code>head</code> ,单链表 <code>L</code> 表示为:</p>\n\n<p><code> L<sub>0 </sub>→ L<sub>1 </sub>→ … → L<sub>n-1 </sub>→ L<sub>n </sub></code><br />\n请将其重新排列后变为:</p>\n\n<p><code>L<sub>0 </sub>→ L<sub>n </sub>→ L<sub>1 </sub>→ L<sub>n-1 </sub>→ L<sub>2 </sub>→ L<sub>n-2 </sub>→ …</code></p>\n\n<p>不能只是单纯的改变节点内部的值,而是需要实际的进行节点交换。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626420311-PkUiGI-image.png\" style=\"width: 240px; \" /></p>\n\n<pre>\n<strong>输入: </strong>head = [1,2,3,4]\n<strong>输出: </strong>[1,4,2,3]</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://pic.leetcode-cn.com/1626420320-YUiulT-image.png\" style=\"width: 320px; \" /></p>\n\n<pre>\n<strong>输入: </strong>head = [1,2,3,4,5]\n<strong>输出: </strong>[1,5,2,4,3]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>链表的长度范围为 <code>[1, 5 * 10<sup>4</sup>]</code></li>\n\t<li><code>1 <= node.val <= 1000</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 143 题相同:<a href=\"https://leetcode-cn.com/problems/reorder-list/\">https://leetcode-cn.com/problems/reorder-list/</a> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 45,
|
||||
"likes": 51,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"14.9K\", \"totalSubmission\": \"22.5K\", \"totalAcceptedRaw\": 14917, \"totalSubmissionRaw\": 22519, \"acRate\": \"66.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"17.7K\", \"totalSubmission\": \"26.7K\", \"totalAcceptedRaw\": 17661, \"totalSubmissionRaw\": 26668, \"acRate\": \"66.2%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个二叉树的 <strong>根节点</strong> <code>root</code>,请找出该二叉树的 <strong>最底层 最左边 </strong>节点的值。</p>\n\n<p>假设二叉树中至少有一个节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2020/12/14/tree1.jpg\" style=\"width: 182px; \" /></p>\n\n<pre>\n<strong>输入: </strong>root = [2,1,3]\n<strong>输出: </strong>1\n</pre>\n\n<p><strong>示例 2: </strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2020/12/14/tree2.jpg\" style=\"width: 242px; \" /><strong> </strong></p>\n\n<pre>\n<strong>输入: </strong>[1,2,3,4,null,5,6,null,null,7]\n<strong>输出: </strong>7\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>二叉树的节点个数的范围是 <code>[1,10<sup>4</sup>]</code></li>\n\t<li><meta charset=\"UTF-8\" /><code>-2<sup>31</sup> <= Node.val <= 2<sup>31</sup> - 1</code> </li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 513 题相同: <a href=\"https://leetcode-cn.com/problems/find-bottom-left-tree-value/\">https://leetcode-cn.com/problems/find-bottom-left-tree-value/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 16,
|
||||
"likes": 20,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.9K\", \"totalSubmission\": \"13.5K\", \"totalAcceptedRaw\": 10860, \"totalSubmissionRaw\": 13520, \"acRate\": \"80.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"13.1K\", \"totalSubmission\": \"16.3K\", \"totalAcceptedRaw\": 13060, \"totalSubmissionRaw\": 16348, \"acRate\": \"79.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定两个字符串 <code>s</code> 和 <code>t</code> 。返回 <code>s</code> 中包含 <code>t</code> 的所有字符的最短子字符串。如果 <code>s</code> 中不存在符合条件的子字符串,则返回空字符串 <code>""</code> 。</p>\n\n<p>如果 <code>s</code> 中存在多个符合条件的子字符串,返回任意一个。</p>\n\n<p> </p>\n\n<p><strong>注意: </strong>对于 <code>t</code> 中重复字符,我们寻找的子字符串中该字符数量必须不少于 <code>t</code> 中该字符数量。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "ADOBECODEBANC", t = "ABC"\n<strong>输出:</strong>"BANC" \n<strong>解释:</strong>最短子字符串 "BANC" 包含了字符串 t 的所有字符 'A'、'B'、'C'</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "a", t = "a"\n<strong>输出:</strong>"a"\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "a", t = "aa"\n<strong>输出:</strong>""\n<strong>解释:</strong>t 中两个字符 'a' 均应包含在 s 的子串中,因此没有符合条件的子字符串,返回空字符串。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length, t.length <= 10<sup>5</sup></code></li>\n\t<li><code>s</code> 和 <code>t</code> 由英文字母组成</li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>你能设计一个在 <code>o(n)</code> 时间内解决此问题的算法吗?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 76 题相似(本题答案不唯一):<a href=\"https://leetcode-cn.com/problems/minimum-window-substring/\">https://leetcode-cn.com/problems/minimum-window-substring/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 31,
|
||||
"likes": 39,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.8K\", \"totalSubmission\": \"21.5K\", \"totalAcceptedRaw\": 10791, \"totalSubmissionRaw\": 21511, \"acRate\": \"50.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.9K\", \"totalSubmission\": \"25.7K\", \"totalAcceptedRaw\": 12949, \"totalSubmissionRaw\": 25726, \"acRate\": \"50.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个字符串 <code>s</code> ,请将 <code>s</code> 分割成一些子串,使每个子串都是 <strong>回文串</strong> ,返回 s 所有可能的分割方案。</p>\n\n<p><meta charset=\"UTF-8\" /><strong>回文串</strong> 是正着读和反着读都一样的字符串。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s =<strong> </strong>"google"\n<strong>输出:</strong>[["g","o","o","g","l","e"],["g","oo","g","l","e"],["goog","l","e"]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "aab"\n<strong>输出:</strong>[["a","a","b"],["aa","b"]]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = "a"\n<strong>输出:</strong>[["a"]]</pre>\n\n<p> </p>\n\n<p><b>提示:</b></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 16</code></li>\n\t<li><code>s </code>仅由小写英文字母组成</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 131 题相同: <a href=\"https://leetcode-cn.com/problems/palindrome-partitioning/\">https://leetcode-cn.com/problems/palindrome-partitioning/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 20,
|
||||
"likes": 21,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -144,7 +144,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7K\", \"totalSubmission\": \"9.4K\", \"totalAcceptedRaw\": 7032, \"totalSubmissionRaw\": 9446, \"acRate\": \"74.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"8.5K\", \"totalSubmission\": \"11.3K\", \"totalAcceptedRaw\": 8471, \"totalSubmissionRaw\": 11305, \"acRate\": \"74.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定两个字符串 <code>s1</code> 和 <code>s2</code>,写一个函数来判断 <code>s2</code> 是否包含 <code>s1</code><strong> </strong>的某个变位词。</p>\n\n<p>换句话说,第一个字符串的排列之一是第二个字符串的 <strong>子串</strong> 。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入: </strong>s1 = "ab" s2 = "eidbaooo"\n<strong>输出: </strong>True\n<strong>解释:</strong> s2 包含 s1 的排列之一 ("ba").\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入: </strong>s1= "ab" s2 = "eidboaoo"\n<strong>输出:</strong> False\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s1.length, s2.length <= 10<sup>4</sup></code></li>\n\t<li><code>s1</code> 和 <code>s2</code> 仅包含小写字母</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 567 题相同: <a href=\"https://leetcode-cn.com/problems/permutation-in-string/\">https://leetcode-cn.com/problems/permutation-in-string/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 31,
|
||||
"likes": 39,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"15.4K\", \"totalSubmission\": \"30K\", \"totalAcceptedRaw\": 15379, \"totalSubmissionRaw\": 29989, \"acRate\": \"51.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"18.4K\", \"totalSubmission\": \"35.9K\", \"totalAcceptedRaw\": 18440, \"totalSubmissionRaw\": 35906, \"acRate\": \"51.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个排序的整数数组 <code>nums</code> 和一个整数目标值<code> target</code> ,请在数组中找到 <code>target </code>,并返回其下标。如果目标值不存在于数组中,返回它将会被按顺序插入的位置。</p>\n\n<p>请必须使用时间复杂度为 <code>O(log n)</code> 的算法。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [1,3,5,6], target = 5\n<strong>输出:</strong> 2\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [1,3,5,6], target = 2\n<strong>输出:</strong> 1\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [1,3,5,6], target = 7\n<strong>输出:</strong> 4\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [1,3,5,6], target = 0\n<strong>输出:</strong> 0\n</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre>\n<strong>输入:</strong> nums = [1], target = 0\n<strong>输出:</strong> 0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10<sup>4</sup></code></li>\n\t<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>\n\t<li><code>nums</code> 为<strong>无重复元素</strong>的<strong>升序</strong>排列数组</li>\n\t<li><code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 35 题相同: <a href=\"https://leetcode-cn.com/problems/search-insert-position/\">https://leetcode-cn.com/problems/search-insert-position/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 13,
|
||||
"likes": 17,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.4K\", \"totalSubmission\": \"20.7K\", \"totalAcceptedRaw\": 10377, \"totalSubmissionRaw\": 20665, \"acRate\": \"50.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.5K\", \"totalSubmission\": \"24.9K\", \"totalAcceptedRaw\": 12481, \"totalSubmissionRaw\": 24897, \"acRate\": \"50.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个非空的正整数数组 <code>nums</code> ,请判断能否将这些数字分成元素和相等的两部分。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,5,11,5]\n<strong>输出:</strong>true\n<strong>解释:</strong>nums<strong> </strong>可以分割成 [1, 5, 5] 和 [11] 。</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3,5]\n<strong>输出:</strong>false\n<strong>解释:</strong>nums<strong> </strong>不可以分为和相等的两部分\n</pre>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" /></p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 200</code></li>\n\t<li><code>1 <= nums[i] <= 100</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 416 题相同: <a href=\"https://leetcode-cn.com/problems/partition-equal-subset-sum/\">https://leetcode-cn.com/problems/partition-equal-subset-sum/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 32,
|
||||
"likes": 36,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.9K\", \"totalSubmission\": \"15.8K\", \"totalAcceptedRaw\": 7867, \"totalSubmissionRaw\": 15778, \"acRate\": \"49.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.7K\", \"totalSubmission\": \"19.4K\", \"totalAcceptedRaw\": 9747, \"totalSubmissionRaw\": 19439, \"acRate\": \"50.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一棵二叉搜索树,请 <strong>按中序遍历</strong> 将其重新排列为一棵递增顺序搜索树,使树中最左边的节点成为树的根节点,并且每个节点没有左子节点,只有一个右子节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/11/17/ex1.jpg\" style=\"width: 600px; height: 350px;\" /></p>\n\n<pre>\n<strong>输入:</strong>root = [5,3,6,2,4,null,8,1,null,null,null,7,9]\n<strong>输出:</strong>[1,null,2,null,3,null,4,null,5,null,6,null,7,null,8,null,9]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/11/17/ex2.jpg\" style=\"width: 300px; height: 114px;\" /></p>\n\n<pre>\n<strong>输入:</strong>root = [5,1,7]\n<strong>输出:</strong>[1,null,5,null,7]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树中节点数的取值范围是 <code>[1, 100]</code></li>\n\t<li><code>0 <= Node.val <= 1000</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 897 题相同: <a href=\"https://leetcode-cn.com/problems/increasing-order-search-tree/\">https://leetcode-cn.com/problems/increasing-order-search-tree/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 25,
|
||||
"likes": 28,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -168,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11.3K\", \"totalSubmission\": \"15.2K\", \"totalAcceptedRaw\": 11328, \"totalSubmissionRaw\": 15160, \"acRate\": \"74.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"13.5K\", \"totalSubmission\": \"18.1K\", \"totalAcceptedRaw\": 13524, \"totalSubmissionRaw\": 18149, \"acRate\": \"74.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>完全二叉树是每一层(除最后一层外)都是完全填充(即,节点数达到最大,第 <code>n</code> 层有 <code>2<sup>n-1</sup></code> 个节点)的,并且所有的节点都尽可能地集中在左侧。</p>\n\n<p>设计一个用完全二叉树初始化的数据结构 <code>CBTInserter</code>,它支持以下几种操作:</p>\n\n<ul>\n\t<li><code>CBTInserter(TreeNode root)</code> 使用根节点为 <code>root</code> 的给定树初始化该数据结构;</li>\n\t<li><code>CBTInserter.insert(int v)</code> 向树中插入一个新节点,节点类型为 <code>TreeNode</code>,值为 <code>v</code> 。使树保持完全二叉树的状态,<strong>并返回插入的新节点的父节点的值</strong>;</li>\n\t<li><code>CBTInserter.get_root()</code> 将返回树的根节点。</li>\n</ul>\n\n<p> </p>\n\n<ol>\n</ol>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>inputs = ["CBTInserter","insert","get_root"], inputs = [[[1]],[2],[]]\n<strong>输出:</strong>[null,1,[1,2]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>inputs = ["CBTInserter","insert","insert","get_root"], inputs = [[[1,2,3,4,5,6]],[7],[8],[]]\n<strong>输出:</strong>[null,3,4,[1,2,3,4,5,6,7,8]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>最初给定的树是完全二叉树,且包含 <code>1</code> 到 <code>1000</code> 个节点。</li>\n\t<li>每个测试用例最多调用 <code>CBTInserter.insert</code> 操作 <code>10000</code> 次。</li>\n\t<li>给定节点或插入节点的每个值都在 <code>0</code> 到 <code>5000</code> 之间。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 919 题相同: <a href=\"https://leetcode-cn.com/problems/complete-binary-tree-inserter/\">https://leetcode-cn.com/problems/complete-binary-tree-inserter/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 17,
|
||||
"likes": 20,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.7K\", \"totalSubmission\": \"12.2K\", \"totalAcceptedRaw\": 7657, \"totalSubmissionRaw\": 12217, \"acRate\": \"62.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.4K\", \"totalSubmission\": \"15.1K\", \"totalAcceptedRaw\": 9407, \"totalSubmissionRaw\": 15091, \"acRate\": \"62.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/NfY1m5.json
Normal file
162
leetcode-cn/originData/NfY1m5.json
Normal file
File diff suppressed because one or more lines are too long
161
leetcode-cn/originData/Nsibyl.json
Normal file
161
leetcode-cn/originData/Nsibyl.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p><big><small>给定一个二维矩阵 <code>matrix</code>,</small></big>以下类型的多个请求:</p>\n\n<ul>\n\t<li><big><small>计算其子矩形范围内元素的总和,该子矩阵的左上角为 <code>(row1, col1)</code> ,右下角为 <code>(row2, col2)</code> 。</small></big></li>\n</ul>\n\n<p>实现 <code>NumMatrix</code> 类:</p>\n\n<ul>\n\t<li><code>NumMatrix(int[][] matrix)</code> 给定整数矩阵 <code>matrix</code> 进行初始化</li>\n\t<li><code>int sumRegion(int row1, int col1, int row2, int col2)</code> 返回<big><small>左上角</small></big><big><small> <code>(row1, col1)</code> 、右下角 <code>(row2, col2)</code></small></big> 的子矩阵的元素总和。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://pic.leetcode-cn.com/1626332422-wUpUHT-image.png\" style=\"width: 200px;\" /></p>\n\n<pre>\n<strong>输入:</strong> \n["NumMatrix","sumRegion","sumRegion","sumRegion"]\n[[[[3,0,1,4,2],[5,6,3,2,1],[1,2,0,1,5],[4,1,0,1,7],[1,0,3,0,5]]],[2,1,4,3],[1,1,2,2],[1,2,2,4]]\n<strong>输出:</strong> \n[null, 8, 11, 12]\n\n<strong>解释:</strong>\nNumMatrix numMatrix = new NumMatrix([[3,0,1,4,2],[5,6,3,2,1],[1,2,0,1,5],[4,1,0,1,7],[1,0,3,0,5]]]);\nnumMatrix.sumRegion(2, 1, 4, 3); // return 8 (红色矩形框的元素总和)\nnumMatrix.sumRegion(1, 1, 2, 2); // return 11 (绿色矩形框的元素总和)\nnumMatrix.sumRegion(1, 2, 2, 4); // return 12 (蓝色矩形框的元素总和)\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>m == matrix.length</code></li>\n\t<li><code>n == matrix[i].length</code></li>\n\t<li><code>1 <= m, n <= 200</code><meta charset=\"UTF-8\" /></li>\n\t<li><code>-10<sup>5</sup> <= matrix[i][j] <= 10<sup>5</sup></code></li>\n\t<li><code>0 <= row1 <= row2 < m</code></li>\n\t<li><code>0 <= col1 <= col2 < n</code></li>\n\t<li><meta charset=\"UTF-8\" />最多调用 <code>10<sup>4</sup></code> 次 <code>sumRegion</code> 方法</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 304 题相同: <a href=\"https://leetcode-cn.com/problems/range-sum-query-2d-immutable/\">https://leetcode-cn.com/problems/range-sum-query-2d-immutable/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 25,
|
||||
"likes": 31,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"12.4K\", \"totalSubmission\": \"18.7K\", \"totalAcceptedRaw\": 12374, \"totalSubmissionRaw\": 18674, \"acRate\": \"66.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"14.6K\", \"totalSubmission\": \"22.1K\", \"totalAcceptedRaw\": 14615, \"totalSubmissionRaw\": 22122, \"acRate\": \"66.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<div class=\"title__3Vvk\">\n<p>运用所掌握的数据结构,设计和实现一个 <a href=\"https://baike.baidu.com/item/LRU\" target=\"_blank\">LRU (Least Recently Used,最近最少使用) 缓存机制</a> 。</p>\n\n<p>实现 <code>LRUCache</code> 类:</p>\n\n<ul>\n\t<li><code>LRUCache(int capacity)</code> 以正整数作为容量 <code>capacity</code> 初始化 LRU 缓存</li>\n\t<li><code>int get(int key)</code> 如果关键字 <code>key</code> 存在于缓存中,则返回关键字的值,否则返回 <code>-1</code> 。</li>\n\t<li><code>void put(int key, int value)</code> 如果关键字已经存在,则变更其数据值;如果关键字不存在,则插入该组「关键字-值」。当缓存容量达到上限时,它应该在写入新数据之前删除最久未使用的数据值,从而为新的数据值留出空间。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入</strong>\n["LRUCache", "put", "put", "get", "put", "get", "put", "get", "get", "get"]\n[[2], [1, 1], [2, 2], [1], [3, 3], [2], [4, 4], [1], [3], [4]]\n<strong>输出</strong>\n[null, null, null, 1, null, -1, null, -1, 3, 4]\n\n<strong>解释</strong>\nLRUCache lRUCache = new LRUCache(2);\nlRUCache.put(1, 1); // 缓存是 {1=1}\nlRUCache.put(2, 2); // 缓存是 {1=1, 2=2}\nlRUCache.get(1); // 返回 1\nlRUCache.put(3, 3); // 该操作会使得关键字 2 作废,缓存是 {1=1, 3=3}\nlRUCache.get(2); // 返回 -1 (未找到)\nlRUCache.put(4, 4); // 该操作会使得关键字 1 作废,缓存是 {4=4, 3=3}\nlRUCache.get(1); // 返回 -1 (未找到)\nlRUCache.get(3); // 返回 3\nlRUCache.get(4); // 返回 4\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= capacity <= 3000</code></li>\n\t<li><code>0 <= key <= 10000</code></li>\n\t<li><code>0 <= value <= 10<sup>5</sup></code></li>\n\t<li>最多调用 <code>2 * 10<sup>5</sup></code> 次 <code>get</code> 和 <code>put</code></li>\n</ul>\n</div>\n\n<p> </p>\n\n<p><strong>进阶</strong>:是否可以在 <code>O(1)</code> 时间复杂度内完成这两种操作?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 146 题相同:<a href=\"https://leetcode-cn.com/problems/lru-cache/\">https://leetcode-cn.com/problems/lru-cache/</a> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 39,
|
||||
"likes": 44,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.4K\", \"totalSubmission\": \"17.5K\", \"totalAcceptedRaw\": 9450, \"totalSubmissionRaw\": 17531, \"acRate\": \"53.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"11.2K\", \"totalSubmission\": \"20.8K\", \"totalAcceptedRaw\": 11205, \"totalSubmissionRaw\": 20782, \"acRate\": \"53.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一棵二叉搜索树和其中的一个节点 <code>p</code> ,找到该节点在树中的中序后继。如果节点没有中序后继,请返回 <code>null</code> 。</p>\n\n<p>节点 <code>p</code> 的后继是值比 <code>p.val</code> 大的节点中键值最小的节点,即按中序遍历的顺序节点 <code>p</code> 的下一个节点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/01/23/285_example_1.PNG\" style=\"height: 117px; width: 122px;\" /></p>\n\n<pre>\n<strong>输入:</strong>root = [2,1,3], p = 1\n<strong>输出:</strong>2\n<strong>解释:</strong>这里 1 的中序后继是 2。请注意 p 和返回值都应是 TreeNode 类型。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2019/01/23/285_example_2.PNG\" style=\"height: 229px; width: 246px;\" /></p>\n\n<pre>\n<strong>输入:</strong>root = [5,3,6,2,4,null,null,1], p = 6\n<strong>输出:</strong>null\n<strong>解释:</strong>因为给出的节点没有中序后继,所以答案就返回 <code>null 了。</code>\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>树中节点的数目在范围 <code>[1, 10<sup>4</sup>]</code> 内。</li>\n\t<li><code>-10<sup>5</sup> <= Node.val <= 10<sup>5</sup></code></li>\n\t<li>树中各节点的值均保证唯一。</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 285 题相同: <a href=\"https://leetcode-cn.com/problems/inorder-successor-in-bst/\">https://leetcode-cn.com/problems/inorder-successor-in-bst/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 25,
|
||||
"likes": 28,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -144,7 +144,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"11.3K\", \"totalSubmission\": \"17.8K\", \"totalAcceptedRaw\": 11272, \"totalSubmissionRaw\": 17815, \"acRate\": \"63.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"13.6K\", \"totalSubmission\": \"21.5K\", \"totalAcceptedRaw\": 13556, \"totalSubmissionRaw\": 21486, \"acRate\": \"63.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个由 <code>0</code> 和 <code>1</code> 组成的矩阵 <code>matrix</code> ,找出只包含 <code>1</code> 的最大矩形,并返回其面积。</p>\n\n<p><strong>注意:</strong>此题 <code>matrix</code> 输入格式为一维 <code>01</code> 字符串数组。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/09/14/maximal.jpg\" style=\"width: 402px; height: 322px;\" /></p>\n\n<pre>\n<strong>输入:</strong>matrix = [\"10100\",\"10111\",\"11111\",\"10010\"]\n<strong>输出:</strong>6\n<strong>解释:</strong>最大矩形如上图所示。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>matrix = []\n<strong>输出:</strong>0\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>matrix = [\"0\"]\n<strong>输出:</strong>0\n</pre>\n\n<p><strong>示例 4:</strong></p>\n\n<pre>\n<strong>输入:</strong>matrix = [\"1\"]\n<strong>输出:</strong>1\n</pre>\n\n<p><strong>示例 5:</strong></p>\n\n<pre>\n<strong>输入:</strong>matrix = [\"00\"]\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>rows == matrix.length</code></li>\n\t<li><code>cols == matrix[0].length</code></li>\n\t<li><code>0 <= row, cols <= 200</code></li>\n\t<li><code>matrix[i][j]</code> 为 <code>'0'</code> 或 <code>'1'</code></li>\n</ul>\n\n<p> </p>\n\n<p>注意:本题与主站 85 题相同(输入参数格式不同): <a href=\"https://leetcode-cn.com/problems/maximal-rectangle/\">https://leetcode-cn.com/problems/maximal-rectangle/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Hard",
|
||||
"likes": 28,
|
||||
"likes": 37,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -168,7 +168,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.9K\", \"totalSubmission\": \"10.2K\", \"totalAcceptedRaw\": 5912, \"totalSubmissionRaw\": 10193, \"acRate\": \"58.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.2K\", \"totalSubmission\": \"12.5K\", \"totalAcceptedRaw\": 7243, \"totalSubmissionRaw\": 12471, \"acRate\": \"58.1%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/PTXy4P.json
Normal file
162
leetcode-cn/originData/PTXy4P.json
Normal file
File diff suppressed because one or more lines are too long
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>一个专业的小偷,计划偷窃一个环形街道上沿街的房屋,每间房内都藏有一定的现金。这个地方所有的房屋都 <strong>围成一圈</strong> ,这意味着第一个房屋和最后一个房屋是紧挨着的。同时,相邻的房屋装有相互连通的防盗系统,<strong>如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警</strong> 。</p>\n\n<p>给定一个代表每个房屋存放金额的非负整数数组 <code>nums</code> ,请计算 <strong>在不触动警报装置的情况下</strong> ,今晚能够偷窃到的最高金额。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [2,3,2]\n<strong>输出:</strong>3\n<strong>解释:</strong>你不能先偷窃 1 号房屋(金额 = 2),然后偷窃 3 号房屋(金额 = 2), 因为他们是相邻的。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3,1]\n<strong>输出:</strong>4\n<strong>解释:</strong>你可以先偷窃 1 号房屋(金额 = 1),然后偷窃 3 号房屋(金额 = 3)。\n 偷窃到的最高金额 = 1 + 3 = 4 。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [0]\n<strong>输出:</strong>0\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 100</code></li>\n\t<li><code>0 <= nums[i] <= 1000</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 213 题相同: <a href=\"https://leetcode-cn.com/problems/house-robber-ii/\">https://leetcode-cn.com/problems/house-robber-ii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 12,
|
||||
"likes": 16,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"5.9K\", \"totalSubmission\": \"12K\", \"totalAcceptedRaw\": 5893, \"totalSubmissionRaw\": 12002, \"acRate\": \"49.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.1K\", \"totalSubmission\": \"14.5K\", \"totalAcceptedRaw\": 7122, \"totalSubmissionRaw\": 14539, \"acRate\": \"49.0%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>如果序列 <code>X_1, X_2, ..., X_n</code> 满足下列条件,就说它是 <em>斐波那契式 </em>的:</p>\n\n<ul>\n\t<li><code>n >= 3</code></li>\n\t<li>对于所有 <code>i + 2 <= n</code>,都有 <code>X_i + X_{i+1} = X_{i+2}</code></li>\n</ul>\n\n<p>给定一个<strong>严格递增</strong>的正整数数组形成序列 <code>arr</code> ,找到 <code>arr</code> 中最长的斐波那契式的子序列的长度。如果一个不存在,返回 0 。</p>\n\n<p><em>(回想一下,子序列是从原序列 <code>arr</code> 中派生出来的,它从 <code>arr</code> 中删掉任意数量的元素(也可以不删),而不改变其余元素的顺序。例如, <code>[3, 5, 8]</code> 是 <code>[3, 4, 5, 6, 7, 8]</code> 的一个子序列)</em></p>\n\n<p> </p>\n\n<ul>\n</ul>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入: </strong>arr =<strong> </strong>[1,2,3,4,5,6,7,8]\n<strong>输出: </strong>5\n<strong>解释: </strong>最长的斐波那契式子序列为 [1,2,3,5,8] 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入: </strong>arr =<strong> </strong>[1,3,7,11,12,14,18]\n<strong>输出: </strong>3\n<strong>解释</strong>: 最长的斐波那契式子序列有 [1,11,12]、[3,11,14] 以及 [7,11,18] 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= arr.length <= 1000</code></li>\n\t<li>\n\t<p><code>1 <= arr[i] < arr[i + 1] <= 10^9</code></p>\n\t</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 873 题相同: <a href=\"https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/\">https://leetcode-cn.com/problems/length-of-longest-fibonacci-subsequence/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 26,
|
||||
"likes": 31,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6K\", \"totalSubmission\": \"10.3K\", \"totalAcceptedRaw\": 6039, \"totalSubmissionRaw\": 10307, \"acRate\": \"58.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.3K\", \"totalSubmission\": \"12.5K\", \"totalAcceptedRaw\": 7290, \"totalSubmissionRaw\": 12476, \"acRate\": \"58.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>现在总共有 <code>numCourses</code> 门课需要选,记为 <code>0</code> 到 <code>numCourses-1</code>。</p>\n\n<p>给定一个数组 <code>prerequisites</code> ,它的每一个元素 <code>prerequisites[i]</code> 表示两门课程之间的先修顺序。 例如 <code>prerequisites[i] = [a<sub>i</sub>, b<sub>i</sub>]</code> 表示想要学习课程 <code>a<sub>i</sub></code> ,需要先完成课程 <code>b<sub>i</sub></code> 。</p>\n\n<p>请根据给出的总课程数 <code>numCourses</code> 和表示先修顺序的 <code>prerequisites</code> 得出一个可行的修课序列。</p>\n\n<p>可能会有多个正确的顺序,只要任意返回一种就可以了。如果不可能完成所有课程,返回一个空数组。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> numCourses = 2, prerequisites = [[1,0]] \n<strong>输出: </strong><code>[0,1]</code>\n<strong>解释:</strong> 总共有 2 门课程。要学习课程 1,你需要先完成课程 0。因此,正确的课程顺序为 <code>[0,1] 。</code></pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> numCourses = 4, prerequisites = [[1,0],[2,0],[3,1],[3,2]]\n<strong>输出: </strong><code>[0,1,2,3] or [0,2,1,3]</code>\n<strong>解释:</strong> 总共有 4 门课程。要学习课程 3,你应该先完成课程 1 和课程 2。并且课程 1 和课程 2 都应该排在课程 0 之后。\n 因此,一个正确的课程顺序是 <code>[0,1,2,3]</code> 。另一个正确的排序是 <code>[0,2,1,3]</code> 。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong> numCourses = 1, prerequisites = [] \n<strong>输出: </strong><code>[0]</code>\n<strong>解释:</strong> 总共 1 门课,直接修第一门课就可。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= numCourses <= 2000</code></li>\n\t<li><code>0 <= prerequisites.length <= numCourses * (numCourses - 1)</code></li>\n\t<li><code>prerequisites[i].length == 2</code></li>\n\t<li><code>0 <= ai, bi < numCourses</code></li>\n\t<li><code>ai != bi</code></li>\n\t<li><code>prerequisites</code> 中不存在重复元素</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 210 题相同:<a href=\"https://leetcode-cn.com/problems/course-schedule-ii/\">https://leetcode-cn.com/problems/course-schedule-ii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 12,
|
||||
"likes": 14,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"4.3K\", \"totalSubmission\": \"7.4K\", \"totalAcceptedRaw\": 4287, \"totalSubmissionRaw\": 7432, \"acRate\": \"57.7%\"}",
|
||||
"stats": "{\"totalAccepted\": \"5.2K\", \"totalSubmission\": \"9.1K\", \"totalAcceptedRaw\": 5224, \"totalSubmissionRaw\": 9092, \"acRate\": \"57.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p><strong><a href=\"https://baike.baidu.com/item/字典树/9825209?fr=aladdin\" target=\"_blank\">Trie</a></strong>(发音类似 "try")或者说 <strong>前缀树</strong> 是一种树形数据结构,用于高效地存储和检索字符串数据集中的键。这一数据结构有相当多的应用情景,例如自动补完和拼写检查。</p>\n\n<p>请你实现 Trie 类:</p>\n\n<ul>\n\t<li><code>Trie()</code> 初始化前缀树对象。</li>\n\t<li><code>void insert(String word)</code> 向前缀树中插入字符串 <code>word</code> 。</li>\n\t<li><code>boolean search(String word)</code> 如果字符串 <code>word</code> 在前缀树中,返回 <code>true</code>(即,在检索之前已经插入);否则,返回 <code>false</code> 。</li>\n\t<li><code>boolean startsWith(String prefix)</code> 如果之前已经插入的字符串 <code>word</code> 的前缀之一为 <code>prefix</code> ,返回 <code>true</code> ;否则,返回 <code>false</code> 。</li>\n</ul>\n\n<p> </p>\n\n<p><strong>示例:</strong></p>\n\n<pre>\n<strong>输入</strong>\ninputs = ["Trie", "insert", "search", "search", "startsWith", "insert", "search"]\ninputs = [[], ["apple"], ["apple"], ["app"], ["app"], ["app"], ["app"]]\n<strong>输出</strong>\n[null, null, true, false, true, null, true]\n\n<strong>解释</strong>\nTrie trie = new Trie();\ntrie.insert("apple");\ntrie.search("apple"); // 返回 True\ntrie.search("app"); // 返回 False\ntrie.startsWith("app"); // 返回 True\ntrie.insert("app");\ntrie.search("app"); // 返回 True\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= word.length, prefix.length <= 2000</code></li>\n\t<li><code>word</code> 和 <code>prefix</code> 仅由小写英文字母组成</li>\n\t<li><code>insert</code>、<code>search</code> 和 <code>startsWith</code> 调用次数 <strong>总计</strong> 不超过 <code>3 * 10<sup>4</sup></code> 次</li>\n</ul>\n\n<p> </p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 208 题相同:<a href=\"https://leetcode-cn.com/problems/implement-trie-prefix-tree/\">https://leetcode-cn.com/problems/implement-trie-prefix-tree/</a> </p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 11,
|
||||
"likes": 16,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -162,7 +162,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.3K\", \"totalSubmission\": \"9.5K\", \"totalAcceptedRaw\": 7304, \"totalSubmissionRaw\": 9501, \"acRate\": \"76.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9K\", \"totalSubmission\": \"11.7K\", \"totalAcceptedRaw\": 8965, \"totalSubmissionRaw\": 11685, \"acRate\": \"76.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
162
leetcode-cn/originData/QO5KpG.json
Normal file
162
leetcode-cn/originData/QO5KpG.json
Normal file
File diff suppressed because one or more lines are too long
@@ -9,10 +9,10 @@
|
||||
"titleSlug": "QTMn0o",
|
||||
"content": "<p>English description is not available for the problem. Please switch to Chinese.</p>\n",
|
||||
"translatedTitle": "和为 k 的子数组",
|
||||
"translatedContent": "<p>给定一个整数数组和一个整数 <code>k</code><strong> ,</strong>请找到该数组中和为 <code>k</code><strong> </strong>的连续子数组的个数。</p>\n\n<p> </p>\n\n<p><strong>示例 1 :</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,1,1], k = 2\n<strong>输出:</strong> 2\n<strong>解释:</strong> 此题 [1,1] 与 [1,1] 为两种不同的情况\n</pre>\n\n<p><strong>示例 2 :</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3], k = 3\n<strong>输出:</strong> 2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 2 * 10<sup>4</sup></code></li>\n\t<li><code>-1000 <= nums[i] <= 1000</code></li>\n\t<li>\n\t<p><code>-10<sup>7</sup> <= k <= 10<sup>7</sup></code></p>\n\t</li>\n</ul>\n\n<p> </p>\n\n<p>注意:本题与主站 560 题相同: <a href=\"https://leetcode-cn.com/problems/subarray-sum-equals-k/\">https://leetcode-cn.com/problems/subarray-sum-equals-k/</a></p>\n",
|
||||
"translatedContent": "<p>给定一个整数数组和一个整数 <code>k</code><strong> ,</strong>请找到该数组中和为 <code>k</code><strong> </strong>的连续子数组的个数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,1,1], k = 2\n<strong>输出:</strong> 2\n<strong>解释:</strong> 此题 [1,1] 与 [1,1] 为两种不同的情况\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3], k = 3\n<strong>输出:</strong> 2\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 2 * 10<sup>4</sup></code></li>\n\t<li><code>-1000 <= nums[i] <= 1000</code></li>\n\t<li>\n\t<p><code>-10<sup>7</sup> <= k <= 10<sup>7</sup></code></p>\n\t</li>\n</ul>\n\n<p> </p>\n\n<p>注意:本题与主站 560 题相同: <a href=\"https://leetcode-cn.com/problems/subarray-sum-equals-k/\">https://leetcode-cn.com/problems/subarray-sum-equals-k/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 51,
|
||||
"likes": 61,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"19.3K\", \"totalSubmission\": \"43.9K\", \"totalAcceptedRaw\": 19317, \"totalSubmissionRaw\": 43872, \"acRate\": \"44.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"22.8K\", \"totalSubmission\": \"52.5K\", \"totalAcceptedRaw\": 22842, \"totalSubmissionRaw\": 52521, \"acRate\": \"43.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -185,7 +185,7 @@
|
||||
"editorType": "CKEDITOR",
|
||||
"ugcQuestionId": null,
|
||||
"style": "LEETCODE",
|
||||
"exampleTestcases": "",
|
||||
"exampleTestcases": "[1,1,1]\n2\n[1,2,3]\n3",
|
||||
"__typename": "QuestionNode"
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>多级双向链表中,除了指向下一个节点和前一个节点指针之外,它还有一个子链表指针,可能指向单独的双向链表。这些子列表也可能会有一个或多个自己的子项,依此类推,生成多级数据结构,如下面的示例所示。</p>\n\n<p>给定位于列表第一级的头节点,请扁平化列表,即将这样的多级双向链表展平成普通的双向链表,使所有结点出现在单级双链表中。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]\n<strong>输出:</strong>[1,2,3,7,8,11,12,9,10,4,5,6]\n<strong>解释:\n</strong>\n输入的多级列表如下图所示:\n\n<img src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/12/multilevellinkedlist.png\" style=\"height: 363px; width: 640px;\" />\n\n扁平化后的链表如下图:\n\n<img src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2018/10/12/multilevellinkedlistflattened.png\" style=\"height: 80px; width: 1100px;\" />\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2,null,3]\n<strong>输出:</strong>[1,3,2]\n<strong>解释:\n\n</strong>输入的多级列表如下图所示:\n\n 1---2---NULL\n |\n 3---NULL\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = []\n<strong>输出:</strong>[]\n</pre>\n\n<p> </p>\n\n<p><strong>如何表示测试用例中的多级链表?</strong></p>\n\n<p>以 <strong>示例 1</strong> 为例:</p>\n\n<pre>\n 1---2---3---4---5---6--NULL\n |\n 7---8---9---10--NULL\n |\n 11--12--NULL</pre>\n\n<p>序列化其中的每一级之后:</p>\n\n<pre>\n[1,2,3,4,5,6,null]\n[7,8,9,10,null]\n[11,12,null]\n</pre>\n\n<p>为了将每一级都序列化到一起,我们需要每一级中添加值为 null 的元素,以表示没有节点连接到上一级的上级节点。</p>\n\n<pre>\n[1,2,3,4,5,6,null]\n[null,null,7,8,9,10,null]\n[null,11,12,null]\n</pre>\n\n<p>合并所有序列化结果,并去除末尾的 null 。</p>\n\n<pre>\n[1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>节点数目不超过 <code>1000</code></li>\n\t<li><code>1 <= Node.val <= 10^5</code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 430 题相同: <a href=\"https://leetcode-cn.com/problems/flatten-a-multilevel-doubly-linked-list/\">https://leetcode-cn.com/problems/flatten-a-multilevel-doubly-linked-list/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 25,
|
||||
"likes": 30,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -126,7 +126,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.1K\", \"totalSubmission\": \"14.9K\", \"totalAcceptedRaw\": 9106, \"totalSubmissionRaw\": 14915, \"acRate\": \"61.1%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.9K\", \"totalSubmission\": \"17.9K\", \"totalAcceptedRaw\": 10914, \"totalSubmissionRaw\": 17919, \"acRate\": \"60.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个非空字符串 <code>s</code>,请判断如果 <strong>最多 </strong>从字符串中删除一个字符能否得到一个回文字符串。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong> s = "aba"\n<strong>输出:</strong> true\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong> s = "abca"\n<strong>输出:</strong> true\n<strong>解释:</strong> 可以删除 "c" 字符 或者 "b" 字符\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong> s = "abc"\n<strong>输出:</strong> false</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>5</sup></code></li>\n\t<li><code>s</code> 由小写英文字母组成</li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 680 题相同: <a href=\"https://leetcode-cn.com/problems/valid-palindrome-ii/\">https://leetcode-cn.com/problems/valid-palindrome-ii/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 27,
|
||||
"likes": 30,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"14.2K\", \"totalSubmission\": \"31K\", \"totalAcceptedRaw\": 14231, \"totalSubmissionRaw\": 31045, \"acRate\": \"45.8%\"}",
|
||||
"stats": "{\"totalAccepted\": \"16.8K\", \"totalSubmission\": \"36.7K\", \"totalAcceptedRaw\": 16795, \"totalSubmissionRaw\": 36679, \"acRate\": \"45.8%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个链表,删除链表的倒数第 <code>n</code><em> </em>个结点,并且返回链表的头结点。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img alt=\"\" src=\"https://assets.leetcode.com/uploads/2020/10/03/remove_ex1.jpg\" style=\"width: 542px; height: 222px;\" /></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2,3,4,5], n = 2\n<strong>输出:</strong>[1,2,3,5]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [1], n = 1\n<strong>输出:</strong>[]\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>head = [1,2], n = 1\n<strong>输出:</strong>[1]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>链表中结点的数目为 <code>sz</code></li>\n\t<li><code>1 <= sz <= 30</code></li>\n\t<li><code>0 <= Node.val <= 100</code></li>\n\t<li><code>1 <= n <= sz</code></li>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>能尝试使用一趟扫描实现吗?</p>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 19 题相同: <a href=\"https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/\">https://leetcode-cn.com/problems/remove-nth-node-from-end-of-list/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 32,
|
||||
"likes": 38,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"18.7K\", \"totalSubmission\": \"35.5K\", \"totalAcceptedRaw\": 18665, \"totalSubmissionRaw\": 35509, \"acRate\": \"52.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"22.1K\", \"totalSubmission\": \"42K\", \"totalAcceptedRaw\": 22091, \"totalSubmissionRaw\": 41994, \"acRate\": \"52.6%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "某乐团的演出场地可视作 `num * num` 的二维矩阵 `grid`(左上角坐标为 `[0,0]`),每个位置站有一位成员。乐团共有 `9` 种乐器,乐器编号为 `1~9`,每位成员持有 `1` 个乐器。\n\n为保证声乐混合效果,成员站位规则为:自 `grid` 左上角开始顺时针螺旋形向内循环以 `1,2,...,9` 循环重复排列。例如当 num = `5` 时,站位如图所示\n\n\n\n\n请返回位于场地坐标 [`Xpos`,`Ypos`] 的成员所持乐器编号。\n\n**示例 1:**\n>输入:`num = 3, Xpos = 0, Ypos = 2`\n>\n>输出:`3`\n>\n>解释:\n\n\n\n**示例 2:**\n>输入:`num = 4, Xpos = 1, Ypos = 2`\n>\n>输出:`5`\n>\n>解释:\n\n\n\n**提示:**\n- `1 <= num <= 10^9`\n- `0 <= Xpos, Ypos < num`",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 58,
|
||||
"likes": 62,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -125,7 +125,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"6.6K\", \"totalSubmission\": \"32.8K\", \"totalAcceptedRaw\": 6618, \"totalSubmissionRaw\": 32810, \"acRate\": \"20.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7K\", \"totalSubmission\": \"33.9K\", \"totalAcceptedRaw\": 7022, \"totalSubmissionRaw\": 33910, \"acRate\": \"20.7%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>以数组 <code>intervals</code> 表示若干个区间的集合,其中单个区间为 <code>intervals[i] = [start<sub>i</sub>, end<sub>i</sub>]</code> 。请你合并所有重叠的区间,并返回一个不重叠的区间数组,该数组需恰好覆盖输入中的所有区间。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>intervals = [[1,3],[2,6],[8,10],[15,18]]\n<strong>输出:</strong>[[1,6],[8,10],[15,18]]\n<strong>解释:</strong>区间 [1,3] 和 [2,6] 重叠, 将它们合并为 [1,6].\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>intervals = [[1,4],[4,5]]\n<strong>输出:</strong>[[1,5]]\n<strong>解释:</strong>区间 [1,4] 和 [4,5] 可被视为重叠区间。</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= intervals.length <= 10<sup>4</sup></code></li>\n\t<li><code>intervals[i].length == 2</code></li>\n\t<li><code>0 <= start<sub>i</sub> <= end<sub>i</sub> <= 10<sup>4</sup></code></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 56 题相同: <a href=\"https://leetcode-cn.com/problems/merge-intervals/\">https://leetcode-cn.com/problems/merge-intervals/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 17,
|
||||
"likes": 21,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -150,7 +150,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"8.6K\", \"totalSubmission\": \"15.1K\", \"totalAcceptedRaw\": 8645, \"totalSubmissionRaw\": 15080, \"acRate\": \"57.3%\"}",
|
||||
"stats": "{\"totalAccepted\": \"10.4K\", \"totalSubmission\": \"18.1K\", \"totalAcceptedRaw\": 10359, \"totalSubmissionRaw\": 18074, \"acRate\": \"57.3%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定一个整数数组 <code>nums</code> ,数组中的元素 <strong>互不相同</strong> 。返回该数组所有可能的子集(幂集)。</p>\n\n<p>解集 <strong>不能</strong> 包含重复的子集。你可以按 <strong>任意顺序</strong> 返回解集。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [1,2,3]\n<strong>输出:</strong>[[],[1],[2],[1,2],[3],[1,3],[2,3],[1,2,3]]\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>nums = [0]\n<strong>输出:</strong>[[],[0]]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= nums.length <= 10</code></li>\n\t<li><code>-10 <= nums[i] <= 10</code></li>\n\t<li><code>nums</code> 中的所有元素 <strong>互不相同</strong></li>\n</ul>\n\n<p> </p>\n\n<p><meta charset=\"UTF-8\" />注意:本题与主站 78 题相同: <a href=\"https://leetcode-cn.com/problems/subsets/\">https://leetcode-cn.com/problems/subsets/</a></p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 24,
|
||||
"likes": 26,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -156,7 +156,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"10.2K\", \"totalSubmission\": \"12K\", \"totalAcceptedRaw\": 10244, \"totalSubmissionRaw\": 11977, \"acRate\": \"85.5%\"}",
|
||||
"stats": "{\"totalAccepted\": \"12.3K\", \"totalSubmission\": \"14.4K\", \"totalAcceptedRaw\": 12329, \"totalSubmissionRaw\": 14355, \"acRate\": \"85.9%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user