討論串[閒聊] 每日LeetCode
共 719 篇文章
內容預覽:
https://leetcode.com/problems/longest-arithmetic-subsequence/description/. 1027. Longest Arithmetic Subsequence. 給你一個整數陣列 nums,找出最長的等差子序列長度。. Example
(還有1574個字)
內容預覽:
https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/description/714. Best Time to Buy and Sell Stock with Transaction F
(還有1254個字)
內容預覽:
https://leetcode.com/problems/k-radius-subarray-averages/description/. 2090. K Radius Subarray Averages. 給你一個整數陣列 nums 和一個數字 k 表示左右間距,返回一個陣列 res,. res
(還有2392個字)
內容預覽:
https://leetcode.com/problems/find-the-highest-altitude/description/. 1732. Find the Highest Altitude. 有一個自行車手從高度為0的位置開始騎車,他要經過 n 個點,每個點的海拔. 距離上個點為 ga
(還有715個字)
內容預覽:
其實你的複雜度是 O(n^2). 因為 comb(lnum+rnum, lnum) 這裡是 O(n). 因為是在模 1000000007 底下. 所以其實可以 O(n) 預計算後 O(1) 算出 comb(lnum+rnum, lnum) % (1000000007). https://oi-wik
(還有116個字)