Skip to content

Commit

Permalink
feat: update lc problems
Browse files Browse the repository at this point in the history
  • Loading branch information
yanglbme committed Apr 15, 2022
1 parent 2e04896 commit 845df84
Show file tree
Hide file tree
Showing 229 changed files with 9,134 additions and 9,528 deletions.
152 changes: 76 additions & 76 deletions lcof/summary_en.md

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions lcp/summary_en.md
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
- LCP Solutions
- [LCP 01. 猜数字](/lcp/LCP%2001.%20%E7%8C%9C%E6%95%B0%E5%AD%97/README.md)
- [LCP 02. 分式化简](/lcp/LCP%2002.%20%E5%88%86%E5%BC%8F%E5%8C%96%E7%AE%80/README.md)
- [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)
- [LCP 04. 覆盖](/lcp/LCP%2004.%20%E8%A6%86%E7%9B%96/README.md)
- [LCP 05. 发 LeetCoin](/lcp/LCP%2005.%20%E5%8F%91%20LeetCoin/README.md)
- [LCP 06. 拿硬币](/lcp/LCP%2006.%20%E6%8B%BF%E7%A1%AC%E5%B8%81/README.md)
- [LCP 07. 传递信息](/lcp/LCP%2007.%20%E4%BC%A0%E9%80%92%E4%BF%A1%E6%81%AF/README.md)
- [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)
- [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)
- [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)
- [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)
- [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)
- [LCP 13. 寻宝](/lcp/LCP%2013.%20%E5%AF%BB%E5%AE%9D/README.md)
- [LCP 14. 切分数组](/lcp/LCP%2014.%20%E5%88%87%E5%88%86%E6%95%B0%E7%BB%84/README.md)
- [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)
- [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)
- [LCP 17. 速算机器人](/lcp/LCP%2017.%20%E9%80%9F%E7%AE%97%E6%9C%BA%E5%99%A8%E4%BA%BA/README.md)
- [LCP 18. 早餐组合](/lcp/LCP%2018.%20%E6%97%A9%E9%A4%90%E7%BB%84%E5%90%88/README.md)
- [LCP 19. 秋叶收藏集](/lcp/LCP%2019.%20%E7%A7%8B%E5%8F%B6%E6%94%B6%E8%97%8F%E9%9B%86/README.md)
- [LCP 20. 快速公交](/lcp/LCP%2020.%20%E5%BF%AB%E9%80%9F%E5%85%AC%E4%BA%A4/README.md)
- [LCP 21. 追逐游戏](/lcp/LCP%2021.%20%E8%BF%BD%E9%80%90%E6%B8%B8%E6%88%8F/README.md)
- [LCP 22. 黑白方格画](/lcp/LCP%2022.%20%E9%BB%91%E7%99%BD%E6%96%B9%E6%A0%BC%E7%94%BB/README.md)
- [LCP 23. 魔术排列](/lcp/LCP%2023.%20%E9%AD%94%E6%9C%AF%E6%8E%92%E5%88%97/README.md)
- [LCP 24. 数字游戏](/lcp/LCP%2024.%20%E6%95%B0%E5%AD%97%E6%B8%B8%E6%88%8F/README.md)
- [LCP 25. 古董键盘](/lcp/LCP%2025.%20%E5%8F%A4%E8%91%A3%E9%94%AE%E7%9B%98/README.md)
- [LCP 26. 导航装置](/lcp/LCP%2026.%20%E5%AF%BC%E8%88%AA%E8%A3%85%E7%BD%AE/README.md)
- [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)
- [LCP 28. 采购方案](/lcp/LCP%2028.%20%E9%87%87%E8%B4%AD%E6%96%B9%E6%A1%88/README.md)
- [LCP 29. 乐团站位](/lcp/LCP%2029.%20%E4%B9%90%E5%9B%A2%E7%AB%99%E4%BD%8D/README.md)
- [LCP 30. 魔塔游戏](/lcp/LCP%2030.%20%E9%AD%94%E5%A1%94%E6%B8%B8%E6%88%8F/README.md)
- [LCP 31. 变换的迷宫](/lcp/LCP%2031.%20%E5%8F%98%E6%8D%A2%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
- [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)
- [LCP 33. 蓄水](/lcp/LCP%2033.%20%E8%93%84%E6%B0%B4/README.md)
- [LCP 34. 二叉树染色](/lcp/LCP%2034.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E6%9F%93%E8%89%B2/README.md)
- [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)
- [LCP 36. 最多牌组数](/lcp/LCP%2036.%20%E6%9C%80%E5%A4%9A%E7%89%8C%E7%BB%84%E6%95%B0/README.md)
- [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)
- [LCP 38. 守卫城堡](/lcp/LCP%2038.%20%E5%AE%88%E5%8D%AB%E5%9F%8E%E5%A0%A1/README.md)
- [LCP 39. 无人机方阵](/lcp/LCP%2039.%20%E6%97%A0%E4%BA%BA%E6%9C%BA%E6%96%B9%E9%98%B5/README.md)
- [LCP 40. 心算挑战](/lcp/LCP%2040.%20%E5%BF%83%E7%AE%97%E6%8C%91%E6%88%98/README.md)
- [LCP 41. 黑白翻转棋](/lcp/LCP%2041.%20%E9%BB%91%E7%99%BD%E7%BF%BB%E8%BD%AC%E6%A3%8B/README.md)
- [LCP 42. 玩具套圈](/lcp/LCP%2042.%20%E7%8E%A9%E5%85%B7%E5%A5%97%E5%9C%88/README.md)
- [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)
- [LCP 44. 开幕式焰火](/lcp/LCP%2044.%20%E5%BC%80%E5%B9%95%E5%BC%8F%E7%84%B0%E7%81%AB/README.md)
- [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)
- [LCP 46. 志愿者调配](/lcp/LCP%2046.%20%E5%BF%97%E6%84%BF%E8%80%85%E8%B0%83%E9%85%8D/README.md)
- [LCP 47. 入场安检](/lcp/LCP%2047.%20%E5%85%A5%E5%9C%BA%E5%AE%89%E6%A3%80/README.md)
- [LCP 48. 无限棋局](/lcp/LCP%2048.%20%E6%97%A0%E9%99%90%E6%A3%8B%E5%B1%80/README.md)
- [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)
- LCP Solutions
- [LCP 01. 猜数字](/lcp/LCP%2001.%20%E7%8C%9C%E6%95%B0%E5%AD%97/README.md)
- [LCP 02. 分式化简](/lcp/LCP%2002.%20%E5%88%86%E5%BC%8F%E5%8C%96%E7%AE%80/README.md)
- [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)
- [LCP 04. 覆盖](/lcp/LCP%2004.%20%E8%A6%86%E7%9B%96/README.md)
- [LCP 05. 发 LeetCoin](/lcp/LCP%2005.%20%E5%8F%91%20LeetCoin/README.md)
- [LCP 06. 拿硬币](/lcp/LCP%2006.%20%E6%8B%BF%E7%A1%AC%E5%B8%81/README.md)
- [LCP 07. 传递信息](/lcp/LCP%2007.%20%E4%BC%A0%E9%80%92%E4%BF%A1%E6%81%AF/README.md)
- [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)
- [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)
- [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)
- [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)
- [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)
- [LCP 13. 寻宝](/lcp/LCP%2013.%20%E5%AF%BB%E5%AE%9D/README.md)
- [LCP 14. 切分数组](/lcp/LCP%2014.%20%E5%88%87%E5%88%86%E6%95%B0%E7%BB%84/README.md)
- [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)
- [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)
- [LCP 17. 速算机器人](/lcp/LCP%2017.%20%E9%80%9F%E7%AE%97%E6%9C%BA%E5%99%A8%E4%BA%BA/README.md)
- [LCP 18. 早餐组合](/lcp/LCP%2018.%20%E6%97%A9%E9%A4%90%E7%BB%84%E5%90%88/README.md)
- [LCP 19. 秋叶收藏集](/lcp/LCP%2019.%20%E7%A7%8B%E5%8F%B6%E6%94%B6%E8%97%8F%E9%9B%86/README.md)
- [LCP 20. 快速公交](/lcp/LCP%2020.%20%E5%BF%AB%E9%80%9F%E5%85%AC%E4%BA%A4/README.md)
- [LCP 21. 追逐游戏](/lcp/LCP%2021.%20%E8%BF%BD%E9%80%90%E6%B8%B8%E6%88%8F/README.md)
- [LCP 22. 黑白方格画](/lcp/LCP%2022.%20%E9%BB%91%E7%99%BD%E6%96%B9%E6%A0%BC%E7%94%BB/README.md)
- [LCP 23. 魔术排列](/lcp/LCP%2023.%20%E9%AD%94%E6%9C%AF%E6%8E%92%E5%88%97/README.md)
- [LCP 24. 数字游戏](/lcp/LCP%2024.%20%E6%95%B0%E5%AD%97%E6%B8%B8%E6%88%8F/README.md)
- [LCP 25. 古董键盘](/lcp/LCP%2025.%20%E5%8F%A4%E8%91%A3%E9%94%AE%E7%9B%98/README.md)
- [LCP 26. 导航装置](/lcp/LCP%2026.%20%E5%AF%BC%E8%88%AA%E8%A3%85%E7%BD%AE/README.md)
- [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)
- [LCP 28. 采购方案](/lcp/LCP%2028.%20%E9%87%87%E8%B4%AD%E6%96%B9%E6%A1%88/README.md)
- [LCP 29. 乐团站位](/lcp/LCP%2029.%20%E4%B9%90%E5%9B%A2%E7%AB%99%E4%BD%8D/README.md)
- [LCP 30. 魔塔游戏](/lcp/LCP%2030.%20%E9%AD%94%E5%A1%94%E6%B8%B8%E6%88%8F/README.md)
- [LCP 31. 变换的迷宫](/lcp/LCP%2031.%20%E5%8F%98%E6%8D%A2%E7%9A%84%E8%BF%B7%E5%AE%AB/README.md)
- [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)
- [LCP 33. 蓄水](/lcp/LCP%2033.%20%E8%93%84%E6%B0%B4/README.md)
- [LCP 34. 二叉树染色](/lcp/LCP%2034.%20%E4%BA%8C%E5%8F%89%E6%A0%91%E6%9F%93%E8%89%B2/README.md)
- [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)
- [LCP 36. 最多牌组数](/lcp/LCP%2036.%20%E6%9C%80%E5%A4%9A%E7%89%8C%E7%BB%84%E6%95%B0/README.md)
- [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)
- [LCP 38. 守卫城堡](/lcp/LCP%2038.%20%E5%AE%88%E5%8D%AB%E5%9F%8E%E5%A0%A1/README.md)
- [LCP 39. 无人机方阵](/lcp/LCP%2039.%20%E6%97%A0%E4%BA%BA%E6%9C%BA%E6%96%B9%E9%98%B5/README.md)
- [LCP 40. 心算挑战](/lcp/LCP%2040.%20%E5%BF%83%E7%AE%97%E6%8C%91%E6%88%98/README.md)
- [LCP 41. 黑白翻转棋](/lcp/LCP%2041.%20%E9%BB%91%E7%99%BD%E7%BF%BB%E8%BD%AC%E6%A3%8B/README.md)
- [LCP 42. 玩具套圈](/lcp/LCP%2042.%20%E7%8E%A9%E5%85%B7%E5%A5%97%E5%9C%88/README.md)
- [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)
- [LCP 44. 开幕式焰火](/lcp/LCP%2044.%20%E5%BC%80%E5%B9%95%E5%BC%8F%E7%84%B0%E7%81%AB/README.md)
- [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)
- [LCP 46. 志愿者调配](/lcp/LCP%2046.%20%E5%BF%97%E6%84%BF%E8%80%85%E8%B0%83%E9%85%8D/README.md)
- [LCP 47. 入场安检](/lcp/LCP%2047.%20%E5%85%A5%E5%9C%BA%E5%AE%89%E6%A3%80/README.md)
- [LCP 48. 无限棋局](/lcp/LCP%2048.%20%E6%97%A0%E9%99%90%E6%A3%8B%E5%B1%80/README.md)
- [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)
8 changes: 4 additions & 4 deletions lcs/summary_en.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
- LCS Solutions
- [LCS 01. 下载插件](/lcs/LCS%2001.%20%E4%B8%8B%E8%BD%BD%E6%8F%92%E4%BB%B6/README.md)
- [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)
- [LCS 03. 主题空间](/lcs/LCS%2003.%20%E4%B8%BB%E9%A2%98%E7%A9%BA%E9%97%B4/README.md)
- LCS Solutions
- [LCS 01. 下载插件](/lcs/LCS%2001.%20%E4%B8%8B%E8%BD%BD%E6%8F%92%E4%BB%B6/README.md)
- [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)
- [LCS 03. 主题空间](/lcs/LCS%2003.%20%E4%B8%BB%E9%A2%98%E7%A9%BA%E9%97%B4/README.md)
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

<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>

<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>
<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>

<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
Expand Down
16 changes: 8 additions & 8 deletions solution/0000-0099/0028.Implement strStr()/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,19 @@

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

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

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

<p> </p>
<p>&nbsp;</p>

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

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

<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>
<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>

<p> </p>
<p>&nbsp;</p>

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

Expand All @@ -41,12 +41,12 @@
<strong>输出:</strong>0
</pre>

<p> </p>
<p>&nbsp;</p>

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

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

Expand Down
24 changes: 14 additions & 10 deletions solution/0000-0099/0028.Implement strStr()/README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,35 @@

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

<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>
<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>

<p><strong>Clarification:</strong></p>

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

<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>
<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>

<p>&nbsp;</p>
<p><strong>Example 1:</strong></p>
<pre><strong>Input:</strong> haystack = "hello", needle = "ll"

<pre>
<strong>Input:</strong> haystack = &quot;hello&quot;, needle = &quot;ll&quot;
<strong>Output:</strong> 2
</pre><p><strong>Example 2:</strong></p>
<pre><strong>Input:</strong> haystack = "aaaaa", needle = "bba"
</pre>

<p><strong>Example 2:</strong></p>

<pre>
<strong>Input:</strong> haystack = &quot;aaaaa&quot;, needle = &quot;bba&quot;
<strong>Output:</strong> -1
</pre><p><strong>Example 3:</strong></p>
<pre><strong>Input:</strong> haystack = "", needle = ""
<strong>Output:</strong> 0
</pre>

<p>&nbsp;</p>
<p><strong>Constraints:</strong></p>

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

## Solutions
Expand Down
28 changes: 7 additions & 21 deletions solution/0000-0099/0035.Search Insert Position/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

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

<p> </p>
<p>&nbsp;</p>

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

Expand All @@ -19,7 +19,7 @@
<strong>输出:</strong> 2
</pre>

<p><strong>示例 2:</strong></p>
<p><strong>示例&nbsp;2:</strong></p>

<pre>
<strong>输入:</strong> nums = [1,3,5,6], target = 2
Expand All @@ -33,29 +33,15 @@
<strong>输出:</strong> 4
</pre>

<p><strong>示例 4:</strong></p>

<pre>
<strong>输入:</strong> nums = [1,3,5,6], target = 0
<strong>输出:</strong> 0
</pre>

<p><strong>示例 5:</strong></p>

<pre>
<strong>输入:</strong> nums = [1], target = 0
<strong>输出:</strong> 0
</pre>

<p> </p>
<p>&nbsp;</p>

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

<ul>
<li><code>1 <= nums.length <= 10<sup>4</sup></code></li>
<li><code>-10<sup>4</sup> <= nums[i] <= 10<sup>4</sup></code></li>
<li><code>nums</code> 为<strong>无重复元素</strong>的<strong>升序</strong>排列数组</li>
<li><code>-10<sup>4</sup> <= target <= 10<sup>4</sup></code></li>
<li><code>1 &lt;= nums.length &lt;= 10<sup>4</sup></code></li>
<li><code>-10<sup>4</sup> &lt;= nums[i] &lt;= 10<sup>4</sup></code></li>
<li><code>nums</code> 为&nbsp;<strong>无重复元素&nbsp;</strong>的&nbsp;<strong>升序&nbsp;</strong>排列数组</li>
<li><code>-10<sup>4</sup> &lt;= target &lt;= 10<sup>4</sup></code></li>
</ul>

## 解法
Expand Down
14 changes: 7 additions & 7 deletions solution/0000-0099/0037.Sudoku Solver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
<p>数独的解法需<strong> 遵循如下规则</strong>:</p>

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

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

<p> </p>
<p>&nbsp;</p>

<div class="top-view__1vxA">
<div class="original__bRMd">
<div>
<p><strong>示例:</strong></p>
<p><strong>示例 1:</strong></p>
<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" />
<pre>
<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"]]
Expand All @@ -33,7 +33,7 @@
<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" />
</pre>

<p> </p>
<p>&nbsp;</p>

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

Expand Down
Loading

0 comments on commit 845df84

Please sign in to comment.