LeetCode刷題(持續更新ing……)


准備刷題了!已經預見未來的日子是苦並快樂的了!雖然 N 年前刷過題,但現在感覺數據結構與算法的基本功快忘光了😭

由於本人主要使用 PHP 語言,所以刷題主要用 PHP 來寫代碼

由易到難,走起!💃越努力,才能越有底氣呀!💪

題號 題目 數據結構 難度
題解
1 Two Sum 兩數之和 數組/哈希表 簡單 #1-Two Sum-兩數之和
15 Three Sum 三數之和 數組 中等 #15-Three Sum-三數之和
26 Remove Duplicates from Sorted Array 刪除有序數組中的重復元素 數組 簡單 #26-Remove Duplicates from Sorted Array-刪除有序數組中的重復元素
27 Remove Element 移除元素 數組 簡單 #27-Remove Element-移除元素
35 Search Insert Position 搜索插入位置 數組 簡單 #35-Search Insert Position-搜索插入位置
442 Find All Duplicates in an Array 數組中重復的數字 數組 中等 #442-Find All Duplicates in an Array-數組中重復的數字
136 Single Number 只出現一次的數字 哈希表 簡單 #136-Single Number-只出現一次的數字
28 Implement strStr() 實現strStr() 字符串 簡單 #28-Implement strStr()-實現strStr()
38 Count and Say 外觀數列 字符串 簡單 #38-Count and Say-外觀數列
344 Reverse String 反轉字符串 字符串 簡單 #344-Reverse String-反轉字符串
345 Reverse Vowels of a String 反轉字符串中的元音字母 字符串 簡單 #345-Reverse Vowels of a String-反轉字符串中的元音字母
隊列
20 Valid Parentheses 有效的括號 簡單 #20-Valid Parentheses-有效的括號
225 Implement Stack using Queues 用隊列實現棧 簡單 #225-Implement Stack using Queues-用隊列實現棧
232 Implement Queue using Stacks 用棧實現隊列 簡單 #232-Implement Queue using Stacks-用棧實現隊列
1047 Remove All Adjacent Duplicates In String 刪除字符串中的所有相鄰重復項 簡單 #1047-Remove All Adjacent Duplicates In String-刪除字符串中的所有相鄰重復項
2 Add Two Numbers 鏈表 中等 #2-Add Two Numbers-兩數相加
21 Merge Two Sorted Lists 合並兩個有序鏈表 鏈表 簡單 #21-Merge Two Sorted Lists-合並兩個有序鏈表
83 Remove Duplicates from Sorted List 刪除排序鏈表中的重復元素 鏈表 簡單 #83-Remove Duplicates from Sorted List-刪除排序鏈表中的重復元素
160 Intersection of Two Linked Lists 相交鏈表 鏈表 簡單 #160-Intersection of Two Linked Lists-相交鏈表
203 Remove Linked List Elements 移除鏈表元素 鏈表 簡單 #203-Remove Linked List Elements-移除鏈表元素
遞歸


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM