原创 LeetCode169 Majority Element-python(easy)

題目來源:https://leetcode.com/problems/majority-element/description/題目分析:給定一個n維的數組,尋找出現次數最多的那個元素。那個出現最多的元素至少會在數組中出現一半,要我們求出

原创 LeetCode53. Maximum Subarray-python(easy) DP思想

題目來源:   https://leetcode.com/problems/maximum-subarray/discuss/20193/DP-solution-and-some-thoughts題目分析:   本題的意思很簡單,即給出一

原创 LeetCode38. Count and Say-python(easy)

題目來源:     https://leetcode.com/problems/count-and-say/description/題目分析:   首先,題目告訴我們count and say是這樣的序列:1. 1 2.

原创 LeetCode66. Plus One-python(easy)

題目來源:     https://leetcode.com/problems/plus-one/description/題目分析:   本題它字面上的解釋有點沒有看懂,看了別人的解釋才理解。它的意思是給定一個數組,將期最後一個元素加1,

原创 LeetCode118. Pascal's Triangle-python(easy)

題目來源:    https://leetcode.com/problems/pascals-triangle/description/題目分析:    本題旨在給定一個整數作爲層數,然後輸出該層的Pascal's triangle.形如

原创 LeetCode121. Best Time to Buy and Sell Stock-python(easy)

題目來源:        https://leetcode.com/problems/best-time-to-buy-and-sell-stock/description/題目分析:       本題給定了一個數組,其中每個元素代表當天

原创 LeetCode 26. Remove Duplicates from Sorted Array——python(easy)

題目來源:             https://leetcode.com/problems/remove-duplicates-from-sorted-array/description/ 題目分析:  本題是給定一個排好序的數組,去