02 2023 档案
摘要:122.买卖股票的最佳时机II class Solution { public: int maxProfit(vector<int>& prices) { if (prices.size() == 1) return 0; int maxpro = 0; for (int i = 1; i < pr
阅读全文
摘要:455.分发饼干 class Solution { public: int findContentChildren(vector<int>& g, vector<int>& s) { sort(g.begin(),g.end()); sort(s.begin(),s.end()); int inde
阅读全文
摘要:51. N皇后 class Solution { private: vector<vector<string>> result; void backtracking(int n, int row, vector<string>& chessboard) { if (row == n) { resul
阅读全文
摘要:491.递增子序列 class Solution { public: vector<vector<int>> result; vector<int> path; void backtracking(vector<int>& nums, int startIndex) { if (path.size(
阅读全文
摘要:93.复原IP地址 class Solution { public: vector<string> result; void backtracking(string& s, int startIndex, int pointNum) { if (pointNum == 3) { if (isVali
阅读全文