上一页 1 2 3 4 5 6 ··· 22 下一页
摘要: 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 阅读(135) 评论(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 阅读(110) 评论(0) 推荐(0) 编辑
摘要: ph 阅读全文
posted @ 2017-10-26 01:17 Weiyu Wang 阅读(89) 评论(0) 推荐(0) 编辑
摘要: select d.Name Department, e1.Name Employee, e1.Salary from Employee e1 join Department d on e1.DepartmentId = d.Id where 3 > (select count(distinct(e2.Salary)) from Employee e2 ... 阅读全文
posted @ 2017-10-25 04:41 Weiyu Wang 阅读(103) 评论(0) 推荐(0) 编辑
摘要: SELECT dep.Name as Department, emp.Name as Employee, emp.Salary from Department dep, Employee emp where emp.DepartmentId=dep.Id and emp.Salary=(Select max(Salary) from Employee e2 where e2.Departm... 阅读全文
posted @ 2017-10-25 04:40 Weiyu Wang 阅读(69) 评论(0) 推荐(0) 编辑
摘要: Select DISTINCT l1.Num from Logs l1, Logs l2, Logs l3 where l1.Id=l2.Id-1 and l2.Id=l3.Id-1 and l1.Num=l2.Num and l2.Num=l3.Num 阅读全文
posted @ 2017-10-25 04:39 Weiyu Wang 阅读(107) 评论(0) 推荐(0) 编辑
摘要: class Solution { public String largestNumber(int[] nums) { String[] arr=new String[nums.length]; for(int i=0;i{return new String(b+a).compareTo(a+b);}); if(arr[0].charAt(0... 阅读全文
posted @ 2017-10-25 04:35 Weiyu Wang 阅读(92) 评论(0) 推荐(0) 编辑
摘要: SELECT Score, (SELECT count(distinct Score) FROM Scores WHERE Score >= s.Score) Rank FROM Scores s ORDER BY Score desc 阅读全文
posted @ 2017-10-25 03:13 Weiyu Wang 阅读(95) 评论(0) 推荐(0) 编辑
摘要: CREATE FUNCTION getNthHighestSalary(N INT) RETURNS INT BEGIN DECLARE M INT; SET M=N-1; RETURN ( # Write your MySQL query statement below. SELECT DISTINCT Salary FROM Employee ORDER BY S... 阅读全文
posted @ 2017-10-25 03:10 Weiyu Wang 阅读(236) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int calculateMinimumHP(int[][] dungeon) { if(dungeon.length==0||dungeon[0].length==0) return 0; int M=dungeon.length; int N=dungeon[0].... 阅读全文
posted @ 2017-10-25 02:55 Weiyu Wang 阅读(86) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 22 下一页