摘要:
Java实现如下: public class Solution { public int coinChange(int[] coins, int amount) { if (amount == 0) return 0; int[] dp = new int[amount + 1]; dp[0] = 阅读全文
摘要:
public class Solution { public int MinAddToMakeValid(string S) { Stack ST = new Stack(); foreach (var s in S) { if (s.Equals('(... 阅读全文
摘要:
public class Solution { public int[] SortArrayByParityII(int[] A) { var len = A.Length; int[] ODD = new int[len / 2];//奇数1,3,5,7,9 int[] EVEN =... 阅读全文
摘要:
class Solution { public: ListNode* sortList(ListNode* head) { multimap mul; while(head){ mul.insert(make_pair(head->val,head)); head=head->next; } ... 阅读全文
摘要:
补充另一种写法: 参考:https://leetcode.com/problems/partition-equal-subset-sum/discuss/90592/01-knapsack-detailed-explanation 先上一张图:测试数据为nums=[1,3,3,5],判断是否可以分割 阅读全文