
LeetCode
文章平均质量分 68
TWCSrookie
人生25方始悟
展开
-
[python]LeetCode_633. Sum of Square Numbers
[python]LeetCode_633. Sum of Square Numbers 文章目录[python]LeetCode_633. Sum of Square Numbers牽涉概念及時間紀錄一、題目內容二、想法思路1.直觀想法:2.覺得太慢了,想優化一下:总结 牽涉概念及時間紀錄 20220409 16:15-16:24 for 第一次 與167題相似使用頭尾往中間的查找法 a**2與aa的速度比較,aa快很多 一、題目內容 簡而言之: 給一數字是否可以由兩個數字的平方值相加而得呢? 以下原创 2022-04-09 16:54:48 · 856 阅读 · 0 评论 -
[python]LeetCode_167. Two Sum II - Input Array Is Sorted
[python]LeetCode_167. Two Sum II - Input Array Is Sorted 文章目录[python]LeetCode_167. Two Sum II - Input Array Is Sorted牽涉概念及時間紀錄一、題目內容二、想法思路1.直觀想法:2.想想發現不太對,優化一下:总结 牽涉概念及時間紀錄 20220408 17:08-17:20 for 第一次 使用雙指針方式能降低時間複雜度 當需要雙迴圈時可以往此方向考慮 一、題目內容 簡而言之: 就是給定一個原创 2022-04-08 20:13:30 · 800 阅读 · 0 评论 -
[python]LeetCode_796. Rotate String
[python]LeetCode_796. Rotate String 文章目录[python]LeetCode_796. Rotate String牽涉概念及時間紀錄一、題目內容二、想法思路1.直觀想法:2.由於只有better than 66%故參考他人作法:总结 牽涉概念及時間紀錄 20220407 11:08-11:19 for 第一次 直接使用字串比較。 較佳解為使用KMP 演算法實作。 一、題目內容 Given two strings s and goal, return true if原创 2022-04-07 15:56:21 · 693 阅读 · 0 评论 -
[python]LeetCode_744. Find Smallest Letter Greater Than Target
[python]LeetCode_744. Find Smallest Letter Greater Than Target 文章目录[python]LeetCode_744. Find Smallest Letter Greater Than Target牽涉概念及時間紀錄一、題目內容二、想法思路1.直觀想法:2.重新看一遍題目後:总结 牽涉概念及時間紀錄 20220403 17:43-17:54 for 第一次 使用binary search 即可 在python 中要判斷ascii 要用 ord(原创 2022-04-03 19:01:55 · 847 阅读 · 0 评论