Skip to content

Commit 845df84

Browse files
committed
feat: update lc problems
1 parent 2e04896 commit 845df84

File tree

229 files changed

+9134
-9528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

229 files changed

+9134
-9528
lines changed

lcof/summary_en.md

+76-76
Large diffs are not rendered by default.

lcp/summary_en.md

+50-50
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,50 @@
1-
- LCP Solutions
2-
- [LCP 01. 猜数字](/lcp/LCP%2001.%20%E7%8C%9C%E6%95%B0%E5%AD%97/README.md)
3-
- [LCP 02. 分式化简](/lcp/LCP%2002.%20%E5%88%86%E5%BC%8F%E5%8C%96%E7%AE%80/README.md)
4-
- [LCP 03. 机器人大冒险](/lcp/LCP%2003.%20%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%A4%A7%E5%86%92%E9%99%A9/README.md)
5-
- [LCP 04. 覆盖](/lcp/LCP%2004.%20%E8%A6%86%E7%9B%96/README.md)
6-
- [LCP 05. 发 LeetCoin](/lcp/LCP%2005.%20%E5%8F%91%20LeetCoin/README.md)
7-
- [LCP 06. 拿硬币](/lcp/LCP%2006.%20%E6%8B%BF%E7%A1%AC%E5%B8%81/README.md)
8-
- [LCP 07. 传递信息](/lcp/LCP%2007.%20%E4%BC%A0%E9%80%92%E4%BF%A1%E6%81%AF/README.md)
9-
- [LCP 08. 剧情触发时间](/lcp/LCP%2008.%20%E5%89%A7%E6%83%85%E8%A7%A6%E5%8F%91%E6%97%B6%E9%97%B4/README.md)
10-
- [LCP 09. 最小跳跃次数](/lcp/LCP%2009.%20%E6%9C%80%E5%B0%8F%E8%B7%B3%E8%B7%83%E6%AC%A1%E6%95%B0/README.md)
11-
- [LCP 10. 二叉树任务调度](/lcp/LCP%2010.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6/README.md)
12-
- [LCP 11. 期望个数统计](/lcp/LCP%2011.%20%E6%9C%9F%E6%9C%9B%E4%B8%AA%E6%95%B0%E7%BB%9F%E8%AE%A1/README.md)
13-
- [LCP 12. 小张刷题计划](/lcp/LCP%2012.%20%E5%B0%8F%E5%BC%A0%E5%88%B7%E9%A2%98%E8%AE%A1%E5%88%92/README.md)
14-
- [LCP 13. 寻宝](/lcp/LCP%2013.%20%E5%AF%BB%E5%AE%9D/README.md)
15-
- [LCP 14. 切分数组](/lcp/LCP%2014.%20%E5%88%87%E5%88%86%E6%95%B0%E7%BB%84/README.md)
16-
- [LCP 15. 游乐园的迷宫](/lcp/LCP%2015.%20%E6%B8%B8%E4%B9%90%E5%9B%AD%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
17-
- [LCP 16. 游乐园的游览计划](/lcp/LCP%2016.%20%E6%B8%B8%E4%B9%90%E5%9B%AD%E7%9A%84%E6%B8%B8%E8%A7%88%E8%AE%A1%E5%88%92/README.md)
18-
- [LCP 17. 速算机器人](/lcp/LCP%2017.%20%E9%80%9F%E7%AE%97%E6%9C%BA%E5%99%A8%E4%BA%BA/README.md)
19-
- [LCP 18. 早餐组合](/lcp/LCP%2018.%20%E6%97%A9%E9%A4%90%E7%BB%84%E5%90%88/README.md)
20-
- [LCP 19. 秋叶收藏集](/lcp/LCP%2019.%20%E7%A7%8B%E5%8F%B6%E6%94%B6%E8%97%8F%E9%9B%86/README.md)
21-
- [LCP 20. 快速公交](/lcp/LCP%2020.%20%E5%BF%AB%E9%80%9F%E5%85%AC%E4%BA%A4/README.md)
22-
- [LCP 21. 追逐游戏](/lcp/LCP%2021.%20%E8%BF%BD%E9%80%90%E6%B8%B8%E6%88%8F/README.md)
23-
- [LCP 22. 黑白方格画](/lcp/LCP%2022.%20%E9%BB%91%E7%99%BD%E6%96%B9%E6%A0%BC%E7%94%BB/README.md)
24-
- [LCP 23. 魔术排列](/lcp/LCP%2023.%20%E9%AD%94%E6%9C%AF%E6%8E%92%E5%88%97/README.md)
25-
- [LCP 24. 数字游戏](/lcp/LCP%2024.%20%E6%95%B0%E5%AD%97%E6%B8%B8%E6%88%8F/README.md)
26-
- [LCP 25. 古董键盘](/lcp/LCP%2025.%20%E5%8F%A4%E8%91%A3%E9%94%AE%E7%9B%98/README.md)
27-
- [LCP 26. 导航装置](/lcp/LCP%2026.%20%E5%AF%BC%E8%88%AA%E8%A3%85%E7%BD%AE/README.md)
28-
- [LCP 27. 黑盒光线反射](/lcp/LCP%2027.%20%E9%BB%91%E7%9B%92%E5%85%89%E7%BA%BF%E5%8F%8D%E5%B0%84/README.md)
29-
- [LCP 28. 采购方案](/lcp/LCP%2028.%20%E9%87%87%E8%B4%AD%E6%96%B9%E6%A1%88/README.md)
30-
- [LCP 29. 乐团站位](/lcp/LCP%2029.%20%E4%B9%90%E5%9B%A2%E7%AB%99%E4%BD%8D/README.md)
31-
- [LCP 30. 魔塔游戏](/lcp/LCP%2030.%20%E9%AD%94%E5%A1%94%E6%B8%B8%E6%88%8F/README.md)
32-
- [LCP 31. 变换的迷宫](/lcp/LCP%2031.%20%E5%8F%98%E6%8D%A2%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
33-
- [LCP 32. 批量处理任务](/lcp/LCP%2032.%20%E6%89%B9%E9%87%8F%E5%A4%84%E7%90%86%E4%BB%BB%E5%8A%A1/README.md)
34-
- [LCP 33. 蓄水](/lcp/LCP%2033.%20%E8%93%84%E6%B0%B4/README.md)
35-
- [LCP 34. 二叉树染色](/lcp/LCP%2034.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E6%9F%93%E8%89%B2/README.md)
36-
- [LCP 35. 电动车游城市](/lcp/LCP%2035.%20%E7%94%B5%E5%8A%A8%E8%BD%A6%E6%B8%B8%E5%9F%8E%E5%B8%82/README.md)
37-
- [LCP 36. 最多牌组数](/lcp/LCP%2036.%20%E6%9C%80%E5%A4%9A%E7%89%8C%E7%BB%84%E6%95%B0/README.md)
38-
- [LCP 37. 最小矩形面积](/lcp/LCP%2037.%20%E6%9C%80%E5%B0%8F%E7%9F%A9%E5%BD%A2%E9%9D%A2%E7%A7%AF/README.md)
39-
- [LCP 38. 守卫城堡](/lcp/LCP%2038.%20%E5%AE%88%E5%8D%AB%E5%9F%8E%E5%A0%A1/README.md)
40-
- [LCP 39. 无人机方阵](/lcp/LCP%2039.%20%E6%97%A0%E4%BA%BA%E6%9C%BA%E6%96%B9%E9%98%B5/README.md)
41-
- [LCP 40. 心算挑战](/lcp/LCP%2040.%20%E5%BF%83%E7%AE%97%E6%8C%91%E6%88%98/README.md)
42-
- [LCP 41. 黑白翻转棋](/lcp/LCP%2041.%20%E9%BB%91%E7%99%BD%E7%BF%BB%E8%BD%AC%E6%A3%8B/README.md)
43-
- [LCP 42. 玩具套圈](/lcp/LCP%2042.%20%E7%8E%A9%E5%85%B7%E5%A5%97%E5%9C%88/README.md)
44-
- [LCP 43. 十字路口的交通](/lcp/LCP%2043.%20%E5%8D%81%E5%AD%97%E8%B7%AF%E5%8F%A3%E7%9A%84%E4%BA%A4%E9%80%9A/README.md)
45-
- [LCP 44. 开幕式焰火](/lcp/LCP%2044.%20%E5%BC%80%E5%B9%95%E5%BC%8F%E7%84%B0%E7%81%AB/README.md)
46-
- [LCP 45. 自行车炫技赛场](/lcp/LCP%2045.%20%E8%87%AA%E8%A1%8C%E8%BD%A6%E7%82%AB%E6%8A%80%E8%B5%9B%E5%9C%BA/README.md)
47-
- [LCP 46. 志愿者调配](/lcp/LCP%2046.%20%E5%BF%97%E6%84%BF%E8%80%85%E8%B0%83%E9%85%8D/README.md)
48-
- [LCP 47. 入场安检](/lcp/LCP%2047.%20%E5%85%A5%E5%9C%BA%E5%AE%89%E6%A3%80/README.md)
49-
- [LCP 48. 无限棋局](/lcp/LCP%2048.%20%E6%97%A0%E9%99%90%E6%A3%8B%E5%B1%80/README.md)
50-
- [LCP 49. 环形闯关游戏](/lcp/LCP%2049.%20%E7%8E%AF%E5%BD%A2%E9%97%AF%E5%85%B3%E6%B8%B8%E6%88%8F/README.md)
1+
- LCP Solutions
2+
- [LCP 01. 猜数字](/lcp/LCP%2001.%20%E7%8C%9C%E6%95%B0%E5%AD%97/README.md)
3+
- [LCP 02. 分式化简](/lcp/LCP%2002.%20%E5%88%86%E5%BC%8F%E5%8C%96%E7%AE%80/README.md)
4+
- [LCP 03. 机器人大冒险](/lcp/LCP%2003.%20%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%A4%A7%E5%86%92%E9%99%A9/README.md)
5+
- [LCP 04. 覆盖](/lcp/LCP%2004.%20%E8%A6%86%E7%9B%96/README.md)
6+
- [LCP 05. 发 LeetCoin](/lcp/LCP%2005.%20%E5%8F%91%20LeetCoin/README.md)
7+
- [LCP 06. 拿硬币](/lcp/LCP%2006.%20%E6%8B%BF%E7%A1%AC%E5%B8%81/README.md)
8+
- [LCP 07. 传递信息](/lcp/LCP%2007.%20%E4%BC%A0%E9%80%92%E4%BF%A1%E6%81%AF/README.md)
9+
- [LCP 08. 剧情触发时间](/lcp/LCP%2008.%20%E5%89%A7%E6%83%85%E8%A7%A6%E5%8F%91%E6%97%B6%E9%97%B4/README.md)
10+
- [LCP 09. 最小跳跃次数](/lcp/LCP%2009.%20%E6%9C%80%E5%B0%8F%E8%B7%B3%E8%B7%83%E6%AC%A1%E6%95%B0/README.md)
11+
- [LCP 10. 二叉树任务调度](/lcp/LCP%2010.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E4%BB%BB%E5%8A%A1%E8%B0%83%E5%BA%A6/README.md)
12+
- [LCP 11. 期望个数统计](/lcp/LCP%2011.%20%E6%9C%9F%E6%9C%9B%E4%B8%AA%E6%95%B0%E7%BB%9F%E8%AE%A1/README.md)
13+
- [LCP 12. 小张刷题计划](/lcp/LCP%2012.%20%E5%B0%8F%E5%BC%A0%E5%88%B7%E9%A2%98%E8%AE%A1%E5%88%92/README.md)
14+
- [LCP 13. 寻宝](/lcp/LCP%2013.%20%E5%AF%BB%E5%AE%9D/README.md)
15+
- [LCP 14. 切分数组](/lcp/LCP%2014.%20%E5%88%87%E5%88%86%E6%95%B0%E7%BB%84/README.md)
16+
- [LCP 15. 游乐园的迷宫](/lcp/LCP%2015.%20%E6%B8%B8%E4%B9%90%E5%9B%AD%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
17+
- [LCP 16. 游乐园的游览计划](/lcp/LCP%2016.%20%E6%B8%B8%E4%B9%90%E5%9B%AD%E7%9A%84%E6%B8%B8%E8%A7%88%E8%AE%A1%E5%88%92/README.md)
18+
- [LCP 17. 速算机器人](/lcp/LCP%2017.%20%E9%80%9F%E7%AE%97%E6%9C%BA%E5%99%A8%E4%BA%BA/README.md)
19+
- [LCP 18. 早餐组合](/lcp/LCP%2018.%20%E6%97%A9%E9%A4%90%E7%BB%84%E5%90%88/README.md)
20+
- [LCP 19. 秋叶收藏集](/lcp/LCP%2019.%20%E7%A7%8B%E5%8F%B6%E6%94%B6%E8%97%8F%E9%9B%86/README.md)
21+
- [LCP 20. 快速公交](/lcp/LCP%2020.%20%E5%BF%AB%E9%80%9F%E5%85%AC%E4%BA%A4/README.md)
22+
- [LCP 21. 追逐游戏](/lcp/LCP%2021.%20%E8%BF%BD%E9%80%90%E6%B8%B8%E6%88%8F/README.md)
23+
- [LCP 22. 黑白方格画](/lcp/LCP%2022.%20%E9%BB%91%E7%99%BD%E6%96%B9%E6%A0%BC%E7%94%BB/README.md)
24+
- [LCP 23. 魔术排列](/lcp/LCP%2023.%20%E9%AD%94%E6%9C%AF%E6%8E%92%E5%88%97/README.md)
25+
- [LCP 24. 数字游戏](/lcp/LCP%2024.%20%E6%95%B0%E5%AD%97%E6%B8%B8%E6%88%8F/README.md)
26+
- [LCP 25. 古董键盘](/lcp/LCP%2025.%20%E5%8F%A4%E8%91%A3%E9%94%AE%E7%9B%98/README.md)
27+
- [LCP 26. 导航装置](/lcp/LCP%2026.%20%E5%AF%BC%E8%88%AA%E8%A3%85%E7%BD%AE/README.md)
28+
- [LCP 27. 黑盒光线反射](/lcp/LCP%2027.%20%E9%BB%91%E7%9B%92%E5%85%89%E7%BA%BF%E5%8F%8D%E5%B0%84/README.md)
29+
- [LCP 28. 采购方案](/lcp/LCP%2028.%20%E9%87%87%E8%B4%AD%E6%96%B9%E6%A1%88/README.md)
30+
- [LCP 29. 乐团站位](/lcp/LCP%2029.%20%E4%B9%90%E5%9B%A2%E7%AB%99%E4%BD%8D/README.md)
31+
- [LCP 30. 魔塔游戏](/lcp/LCP%2030.%20%E9%AD%94%E5%A1%94%E6%B8%B8%E6%88%8F/README.md)
32+
- [LCP 31. 变换的迷宫](/lcp/LCP%2031.%20%E5%8F%98%E6%8D%A2%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
33+
- [LCP 32. 批量处理任务](/lcp/LCP%2032.%20%E6%89%B9%E9%87%8F%E5%A4%84%E7%90%86%E4%BB%BB%E5%8A%A1/README.md)
34+
- [LCP 33. 蓄水](/lcp/LCP%2033.%20%E8%93%84%E6%B0%B4/README.md)
35+
- [LCP 34. 二叉树染色](/lcp/LCP%2034.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E6%9F%93%E8%89%B2/README.md)
36+
- [LCP 35. 电动车游城市](/lcp/LCP%2035.%20%E7%94%B5%E5%8A%A8%E8%BD%A6%E6%B8%B8%E5%9F%8E%E5%B8%82/README.md)
37+
- [LCP 36. 最多牌组数](/lcp/LCP%2036.%20%E6%9C%80%E5%A4%9A%E7%89%8C%E7%BB%84%E6%95%B0/README.md)
38+
- [LCP 37. 最小矩形面积](/lcp/LCP%2037.%20%E6%9C%80%E5%B0%8F%E7%9F%A9%E5%BD%A2%E9%9D%A2%E7%A7%AF/README.md)
39+
- [LCP 38. 守卫城堡](/lcp/LCP%2038.%20%E5%AE%88%E5%8D%AB%E5%9F%8E%E5%A0%A1/README.md)
40+
- [LCP 39. 无人机方阵](/lcp/LCP%2039.%20%E6%97%A0%E4%BA%BA%E6%9C%BA%E6%96%B9%E9%98%B5/README.md)
41+
- [LCP 40. 心算挑战](/lcp/LCP%2040.%20%E5%BF%83%E7%AE%97%E6%8C%91%E6%88%98/README.md)
42+
- [LCP 41. 黑白翻转棋](/lcp/LCP%2041.%20%E9%BB%91%E7%99%BD%E7%BF%BB%E8%BD%AC%E6%A3%8B/README.md)
43+
- [LCP 42. 玩具套圈](/lcp/LCP%2042.%20%E7%8E%A9%E5%85%B7%E5%A5%97%E5%9C%88/README.md)
44+
- [LCP 43. 十字路口的交通](/lcp/LCP%2043.%20%E5%8D%81%E5%AD%97%E8%B7%AF%E5%8F%A3%E7%9A%84%E4%BA%A4%E9%80%9A/README.md)
45+
- [LCP 44. 开幕式焰火](/lcp/LCP%2044.%20%E5%BC%80%E5%B9%95%E5%BC%8F%E7%84%B0%E7%81%AB/README.md)
46+
- [LCP 45. 自行车炫技赛场](/lcp/LCP%2045.%20%E8%87%AA%E8%A1%8C%E8%BD%A6%E7%82%AB%E6%8A%80%E8%B5%9B%E5%9C%BA/README.md)
47+
- [LCP 46. 志愿者调配](/lcp/LCP%2046.%20%E5%BF%97%E6%84%BF%E8%80%85%E8%B0%83%E9%85%8D/README.md)
48+
- [LCP 47. 入场安检](/lcp/LCP%2047.%20%E5%85%A5%E5%9C%BA%E5%AE%89%E6%A3%80/README.md)
49+
- [LCP 48. 无限棋局](/lcp/LCP%2048.%20%E6%97%A0%E9%99%90%E6%A3%8B%E5%B1%80/README.md)
50+
- [LCP 49. 环形闯关游戏](/lcp/LCP%2049.%20%E7%8E%AF%E5%BD%A2%E9%97%AF%E5%85%B3%E6%B8%B8%E6%88%8F/README.md)

lcs/summary_en.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- LCS Solutions
2-
- [LCS 01. 下载插件](/lcs/LCS%2001.%20%E4%B8%8B%E8%BD%BD%E6%8F%92%E4%BB%B6/README.md)
3-
- [LCS 02. 完成一半题目](/lcs/LCS%2002.%20%E5%AE%8C%E6%88%90%E4%B8%80%E5%8D%8A%E9%A2%98%E7%9B%AE/README.md)
4-
- [LCS 03. 主题空间](/lcs/LCS%2003.%20%E4%B8%BB%E9%A2%98%E7%A9%BA%E9%97%B4/README.md)
1+
- LCS Solutions
2+
- [LCS 01. 下载插件](/lcs/LCS%2001.%20%E4%B8%8B%E8%BD%BD%E6%8F%92%E4%BB%B6/README.md)
3+
- [LCS 02. 完成一半题目](/lcs/LCS%2002.%20%E5%AE%8C%E6%88%90%E4%B8%80%E5%8D%8A%E9%A2%98%E7%9B%AE/README.md)
4+
- [LCS 03. 主题空间](/lcs/LCS%2003.%20%E4%B8%BB%E9%A2%98%E7%A9%BA%E9%97%B4/README.md)

solution/0000-0099/0017.Letter Combinations of a Phone Number/README_EN.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<p>A mapping of digit to letters (just like on the telephone buttons) is given below. Note that 1 does not map to any letters.</p>
1010

11-
<p><img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0017.Letter%20Combinations%20of%20a%20Phone%20Number/images/200px-telephone-keypad2svg.png" style="width: 200px; height: 162px;" /></p>
11+
<p><img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0017.Letter%20Combinations%20of%20a%20Phone%20Number/images/200px-Telephone-keypad2.svg.png" style="width: 200px; height: 162px;" /></p>
1212

1313
<p>&nbsp;</p>
1414
<p><strong>Example 1:</strong></p>

solution/0000-0099/0028.Implement strStr()/README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@
66

77
<!-- 这里写题目描述 -->
88

9-
<p>实现 <a href="https://baike.baidu.com/item/strstr/811469" target="_blank">strStr()</a> 函数。</p>
9+
<p>实现&nbsp;<a href="https://baike.baidu.com/item/strstr/811469" target="_blank">strStr()</a>&nbsp;函数。</p>
1010

11-
<p>给你两个字符串 <code>haystack</code> 和 <code>needle</code> ,请你在 <code>haystack</code> 字符串中找出 <code>needle</code> 字符串出现的第一个位置(下标从 0 开始)。如果不存在,则返回  <code>-1</code><strong> </strong>。</p>
11+
<p>给你两个字符串&nbsp;<code>haystack</code> 和 <code>needle</code> ,请你在 <code>haystack</code> 字符串中找出 <code>needle</code> 字符串出现的第一个位置(下标从 0 开始)。如果不存在,则返回&nbsp; <code>-1</code><strong> </strong>。</p>
1212

13-
<p> </p>
13+
<p>&nbsp;</p>
1414

1515
<p><strong>说明:</strong></p>
1616

17-
<p>当 <code>needle</code> 是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。</p>
17+
<p>当&nbsp;<code>needle</code>&nbsp;是空字符串时,我们应当返回什么值呢?这是一个在面试中很好的问题。</p>
1818

19-
<p>对于本题而言,当 <code>needle</code> 是空字符串时我们应当返回 0 。这与 C 语言的 <a href="https://baike.baidu.com/item/strstr/811469" target="_blank">strstr()</a> 以及 Java 的 <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String)" target="_blank">indexOf()</a> 定义相符。</p>
19+
<p>对于本题而言,当&nbsp;<code>needle</code>&nbsp;是空字符串时我们应当返回 0 。这与 C 语言的&nbsp;<a href="https://baike.baidu.com/item/strstr/811469" target="_blank">strstr()</a>&nbsp;以及 Java 的&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String)" target="_blank">indexOf()</a>&nbsp;定义相符。</p>
2020

21-
<p> </p>
21+
<p>&nbsp;</p>
2222

2323
<p><strong>示例 1:</strong></p>
2424

@@ -41,12 +41,12 @@
4141
<strong>输出:</strong>0
4242
</pre>
4343

44-
<p> </p>
44+
<p>&nbsp;</p>
4545

4646
<p><strong>提示:</strong></p>
4747

4848
<ul>
49-
<li><code>0 <= haystack.length, needle.length <= 5 * 10<sup>4</sup></code></li>
49+
<li><code>1 &lt;= haystack.length, needle.length &lt;= 10<sup>4</sup></code></li>
5050
<li><code>haystack</code> 和 <code>needle</code> 仅由小写英文字符组成</li>
5151
</ul>
5252

solution/0000-0099/0028.Implement strStr()/README_EN.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,35 @@
66

77
<p>Implement <a href="http://www.cplusplus.com/reference/cstring/strstr/" target="_blank">strStr()</a>.</p>
88

9-
<p>Return the index of the first occurrence of needle in haystack, or <code>-1</code> if <code>needle</code> is not part of <code>haystack</code>.</p>
9+
<p>Given two strings <code>needle</code> and <code>haystack</code>, return the index of the first occurrence of <code>needle</code> in <code>haystack</code>, or <code>-1</code> if <code>needle</code> is not part of <code>haystack</code>.</p>
1010

1111
<p><strong>Clarification:</strong></p>
1212

1313
<p>What should we return when <code>needle</code> is an empty string? This is a great question to ask during an interview.</p>
1414

15-
<p>For the purpose of this problem, we will return 0 when <code>needle</code> is an empty string. This is consistent to C&#39;s&nbsp;<a href="http://www.cplusplus.com/reference/cstring/strstr/" target="_blank">strstr()</a> and Java&#39;s&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String)" target="_blank">indexOf()</a>.</p>
15+
<p>For the purpose of this problem, we will return 0 when <code>needle</code> is an empty string. This is consistent to C&#39;s <a href="http://www.cplusplus.com/reference/cstring/strstr/" target="_blank">strstr()</a> and Java&#39;s <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#indexOf(java.lang.String)" target="_blank">indexOf()</a>.</p>
1616

1717
<p>&nbsp;</p>
1818
<p><strong>Example 1:</strong></p>
19-
<pre><strong>Input:</strong> haystack = "hello", needle = "ll"
19+
20+
<pre>
21+
<strong>Input:</strong> haystack = &quot;hello&quot;, needle = &quot;ll&quot;
2022
<strong>Output:</strong> 2
21-
</pre><p><strong>Example 2:</strong></p>
22-
<pre><strong>Input:</strong> haystack = "aaaaa", needle = "bba"
23+
</pre>
24+
25+
<p><strong>Example 2:</strong></p>
26+
27+
<pre>
28+
<strong>Input:</strong> haystack = &quot;aaaaa&quot;, needle = &quot;bba&quot;
2329
<strong>Output:</strong> -1
24-
</pre><p><strong>Example 3:</strong></p>
25-
<pre><strong>Input:</strong> haystack = "", needle = ""
26-
<strong>Output:</strong> 0
2730
</pre>
31+
2832
<p>&nbsp;</p>
2933
<p><strong>Constraints:</strong></p>
3034

3135
<ul>
32-
<li><code>0 &lt;= haystack.length, needle.length &lt;= 5 * 10<sup>4</sup></code></li>
33-
<li><code>haystack</code> and&nbsp;<code>needle</code> consist of only lower-case English characters.</li>
36+
<li><code>1 &lt;= haystack.length, needle.length &lt;= 10<sup>4</sup></code></li>
37+
<li><code>haystack</code> and <code>needle</code> consist of only lowercase English characters.</li>
3438
</ul>
3539

3640
## Solutions

solution/0000-0099/0035.Search Insert Position/README.md

+7-21
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
<p>请必须使用时间复杂度为 <code>O(log n)</code> 的算法。</p>
1212

13-
<p> </p>
13+
<p>&nbsp;</p>
1414

1515
<p><strong>示例 1:</strong></p>
1616

@@ -19,7 +19,7 @@
1919
<strong>输出:</strong> 2
2020
</pre>
2121

22-
<p><strong>示例 2:</strong></p>
22+
<p><strong>示例&nbsp;2:</strong></p>
2323

2424
<pre>
2525
<strong>输入:</strong> nums = [1,3,5,6], target = 2
@@ -33,29 +33,15 @@
3333
<strong>输出:</strong> 4
3434
</pre>
3535

36-
<p><strong>示例 4:</strong></p>
37-
38-
<pre>
39-
<strong>输入:</strong> nums = [1,3,5,6], target = 0
40-
<strong>输出:</strong> 0
41-
</pre>
42-
43-
<p><strong>示例 5:</strong></p>
44-
45-
<pre>
46-
<strong>输入:</strong> nums = [1], target = 0
47-
<strong>输出:</strong> 0
48-
</pre>
49-
50-
<p> </p>
36+
<p>&nbsp;</p>
5137

5238
<p><strong>提示:</strong></p>
5339

5440
<ul>
55-
<li><code>1 <= nums.length <= 10<sup>4</sup></code></li>
56-
<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>
57-
<li><code>nums</code> 为<strong>无重复元素</strong>的<strong>升序</strong>排列数组</li>
58-
<li><code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code></li>
41+
<li><code>1 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
42+
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
43+
<li><code>nums</code> 为&nbsp;<strong>无重复元素&nbsp;</strong>的&nbsp;<strong>升序&nbsp;</strong>排列数组</li>
44+
<li><code>-10<sup>4</sup> &lt;= target &lt;= 10<sup>4</sup></code></li>
5945
</ul>
6046

6147
## 解法

solution/0000-0099/0037.Sudoku Solver/README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
<p>数独的解法需<strong> 遵循如下规则</strong>:</p>
1212

1313
<ol>
14-
<li>数字 <code>1-9</code> 在每一行只能出现一次。</li>
15-
<li>数字 <code>1-9</code> 在每一列只能出现一次。</li>
16-
<li>数字 <code>1-9</code> 在每一个以粗实线分隔的 <code>3x3</code> 宫内只能出现一次。(请参考示例图)</li>
14+
<li>数字&nbsp;<code>1-9</code>&nbsp;在每一行只能出现一次。</li>
15+
<li>数字&nbsp;<code>1-9</code>&nbsp;在每一列只能出现一次。</li>
16+
<li>数字&nbsp;<code>1-9</code>&nbsp;在每一个以粗实线分隔的&nbsp;<code>3x3</code>&nbsp;宫内只能出现一次。(请参考示例图)</li>
1717
</ol>
1818

19-
<p>数独部分空格内已填入了数字,空白格用 <code>'.'</code> 表示。</p>
19+
<p>数独部分空格内已填入了数字,空白格用&nbsp;<code>'.'</code>&nbsp;表示。</p>
2020

21-
<p> </p>
21+
<p>&nbsp;</p>
2222

2323
<div class="top-view__1vxA">
2424
<div class="original__bRMd">
2525
<div>
26-
<p><strong>示例:</strong></p>
26+
<p><strong>示例 1:</strong></p>
2727
<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0037.Sudoku%20Solver/images/250px-sudoku-by-l2g-20050714svg.png" style="height:250px; width:250px" />
2828
<pre>
2929
<strong>输入:</strong>board = [["5","3",".",".","7",".",".",".","."],["6",".",".","1","9","5",".",".","."],[".","9","8",".",".",".",".","6","."],["8",".",".",".","6",".",".",".","3"],["4",".",".","8",".","3",".",".","1"],["7",".",".",".","2",".",".",".","6"],[".","6",".",".",".",".","2","8","."],[".",".",".","4","1","9",".",".","5"],[".",".",".",".","8",".",".","7","9"]]
@@ -33,7 +33,7 @@
3333
<img src="https://cdn.jsdelivr.net/gh/doocs/leetcode@main/solution/0000-0099/0037.Sudoku%20Solver/images/250px-sudoku-by-l2g-20050714_solutionsvg.png" style="height:250px; width:250px" />
3434
</pre>
3535

36-
<p> </p>
36+
<p>&nbsp;</p>
3737

3838
<p><strong>提示:</strong></p>
3939

0 commit comments

Comments
 (0)