討論串[閒聊] 每日LeetCode
共 719 篇文章
內容預覽:
2439. Minimize Maximum of Array. 給你一個陣列 nums ,你可以做無限次數的下列一串操作(必須同時做):. 1. i 必須滿足 1 <= i < n 且 nums[i] > 0. 2.把 nums[i - 1] 遞增. 3.把 nums[i] 遞減. 試求經過多次操
(還有1747個字)
內容預覽:
2405. Optimal Partition of String. 給定一個字串s,我們想將 s 切成 n 個子字串,這些子字串不可以存在重複的字母,. 求最少需要切成幾個子字串。. Example:. Input: s = "abacaba". Output: 4. Explanation:.
(還有838個字)
內容預覽:
881. Boats to Save People. 給定一個陣列Poople,People[i] 表示第 i 個人的重量,我們有無限艘船且每個船. 最多只能負重 limit 的重量並且最多載兩個人,返回把所有人載走的最少所需船數。. Example :. Input: people = [1,2]
(還有789個字)
內容預覽:
class Solution {. public:. vector<int> successfulPairs(vector<int>& spells, vector<int>& potions,. long long success) {. int i, n = spells.size(), m =
(還有496個字)