上一页 1 2 3 4 5 6 7 ··· 17 下一页
摘要: link class Solution { public: int maxNonOverlapping(vector<int>& nums, int target) { unordered_map<int,int> pos; pos[0]=-1; int sum=0; int n=nums.size 阅读全文
posted @ 2020-08-10 10:44 feibilun 阅读(132) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: int longestAwesome(string s) { int n=s.size(); vector<int> dp(1<<10,n); int res=1; dp[0]=-1; int mask=0; for(int i=0;i<n 阅读全文
posted @ 2020-08-10 09:32 feibilun 阅读(150) 评论(0) 推荐(0) 编辑
摘要: link 随着i增加,缺失的个数非减,在i处缺失的个数为arr[i]-(i+1).二分找到第一个缺失个数大于等于k的位置left, 则left-1处缺失的个数<k。left-1处缺失的个数为arr[left-1]-left, 还差k-arr[left-1]+left个,则答案是k+left. cla 阅读全文
posted @ 2020-08-09 20:53 feibilun 阅读(119) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: struct TrieNode{ TrieNode* children[26]; int id; TrieNode(){ id=-1; for(int i=0;i<26;i++) children[i]=nullptr; } }; Trie 阅读全文
posted @ 2020-08-06 11:14 feibilun 阅读(54) 评论(0) 推荐(0) 编辑
摘要: link prove: @interviewrecipes https://leetcode.com/problems/minimum-swaps-to-arrange-a-binary-grid/discuss/768076/Min-Adjacent-Swaps-to-Sort-the-array 阅读全文
posted @ 2020-08-04 11:05 feibilun 阅读(160) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: vector<string> maxNumOfSubstrings(string s) { int n=s.size(); vector<int> left(26,n); vector<int> right(26,-1); for(int 阅读全文
posted @ 2020-07-19 22:18 feibilun 阅读(129) 评论(0) 推荐(0) 编辑
摘要: link class Solution { public: int n; double eps=1E-6; const int dx[4]={-1,0,1,0}; const int dy[4]={0,1,0,-1}; double getMinDistSum(vector<vector<int>> 阅读全文
posted @ 2020-07-12 17:35 feibilun 阅读(194) 评论(0) 推荐(0) 编辑
摘要: git官网下载: https://www.git-scm.com/download/win ssh 连接 生成密匙: ssh-keygen -t rsa -C "email" 在~/.ssh中生成了key,把.pub复制到github的setting中 测试: ssh -T git@github.c 阅读全文
posted @ 2020-07-08 23:12 feibilun 阅读(129) 评论(0) 推荐(0) 编辑
摘要: link Solution1: class Solution { public: int m; int n; int numSubmat(vector<vector<int>>& mat) { m=mat.size(); n=mat[0].size(); int res=0; for(int up= 阅读全文
posted @ 2020-07-07 09:39 feibilun 阅读(131) 评论(0) 推荐(0) 编辑
摘要: link Given a string num representing the digits of a very large integer and an integer k. You are allowed to swap any two adjacent digits of the integ 阅读全文
posted @ 2020-07-06 04:16 feibilun 阅读(241) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 17 下一页