1. 程式人生 > >LeetCode-day01&02

LeetCode-day01&02

time num 有序 判斷 但是 cat 問題 move 求一個

感覺還好,堅持住就行,畢竟智商不夠

1. Length of Last Word求一個數組的最後一個單詞的長度

2. Plus One 大數加1

3. Add Binary 二進制加法

4. Sqrt(x) 求一個數的開方

5. Valid Perfect Square 求正方形的邊的長度

6. Sum of Square Numbers 將一個數拆分成兩個可以開方的數

7. Factorial Trailing Zeroes 階乘結果0的個數

8. Two Sum 求數組中兩個數的和為target,並返回這兩個數

9. Two Sum II - Input array is sorted 輸入一個有序的數組,按順序返回相加結果為target的這兩個數,下標為1開頭的

10. Two Sum IV - Input is a BST 平衡搜索樹,輸出是否能找到兩個節點值的和為target

11. Reverse Integer 翻轉一個int數

12. Palindrome Number 回文數

13. Palindrome Linked List 判斷是否是回文鏈表,利用了翻轉鏈表,很巧妙********

14 Reverse Linked List 真。翻轉鏈表

15. Valid Palindrome 還是判斷是否是回文,不過是一個String,但是要將不是字母數字的字符去掉

16. Roman to Integer 羅馬數字轉換成數字

17. Valid Parentheses (){}[]的匹配問題

18. Merge Two Sorted Lists 將兩個鏈表融合成一個,註意要按順序拼接

19. Merge Sorted Array 將nums2插入到nums1中去,註意按順序插入

20. Remove Duplicates from Sorted Array 去除數組中重復的數字

21. Remove Element 移出數組中的值為value的所有元素

22. Implement strStr() 第一個字符串包含第二個字符串的最初位置

23. Repeated Substring Pattern 重復子串是否能拼接成這個String

24. Search Insert Position 一個int插入一個數組中,應該插入的位置

25. First Bad Version 第一個壞的數

26. Guess Number Higher or Lower 猜1到n 中的數

27. Maximum Subarray 最大子串和

28. Best Time to Buy and Sell Stock

LeetCode-day01&02