摘要: class Solution { public int numIslands(char[][] grid) { int count=0; for(int i=0;i=grid.length||j=grid[0].length||grid[i][j]!='1') return; grid[i][j]='2'; ... 阅读全文
posted @ 2017-10-26 01:48 Weiyu Wang 阅读(118) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List rightSideView(TreeNode root) { List res=new ArrayList(); rightView(root, res, 0); return res; } private void rightView(TreeNode node, ... 阅读全文
posted @ 2017-10-26 01:31 Weiyu Wang 阅读(119) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int maxProfit(int k, int[] prices) { if(k>=prices.length/2) { int maxProfit=0; for(int i=1;iprices[i-1]?prices[i]-prices[i-1]:0; ... 阅读全文
posted @ 2017-10-26 01:19 Weiyu Wang 阅读(133) 评论(0) 推荐(0) 编辑
摘要: class Solution { public List findRepeatedDnaSequences(String s) { Set set=new HashSet(); Set res=new HashSet(); for(int i=0;i+10(res); } } 阅读全文
posted @ 2017-10-26 01:18 Weiyu Wang 阅读(109) 评论(0) 推荐(0) 编辑
摘要: ph 阅读全文
posted @ 2017-10-26 01:17 Weiyu Wang 阅读(89) 评论(0) 推荐(0) 编辑