最新 最热

Leetcode 1815. 得到新鲜甜甜圈的最多组数(模拟退火)

class Solution {public: vector<int>w; int ans=-1,b; int calc(){ int res=1,s=0; for(int i=0;i<w.size();i++){ s=(s+w[i])%...

2021-04-13
0

(Leetcode 2021 刷题计划) 179. 最大数

给定一组非负整数 nums,重新排列每个数的顺序(每个数不可拆分)使之组成一个最大的整数。

2021-04-12
0

(Leetcode 2021 刷题计划) 263. 丑数

给你一个整数 n ,请你判断 n 是否为 丑数 。如果是,返回 true ;否则,返回 false 。

2021-04-12
0

Leetcode 579. 查询员工的累计薪水(lag 前瞻函数 查看前几行 分组聚合经典例子)

select id,month,salary+ifnull(l1,0)+ifnull(l2,0) salary from (select *,lag(salary,1) over(partition by id order by month ) l1, lag(salary,2) over(p...

2021-04-09
1

Leetcode 196. 删除重复的电子邮箱(暴力、双表连接或者删最值)

delete from person where id not in( select id from( select min(id) id from person group by email)t )

2021-04-08
0

Leetcode 197. 上升的温度(datediff、暴力双表连接)

select w1.id from weather w1 join weather w2 on datediff(w1.recorddate,w2.recorddate)=1 and w1.temperature>w2.temperature

2021-04-08
0

Leetcode 262. 行程和用户(avg函数的巧用)

select request_at "Day",round(avg(`status`!="completed"),2) "Cancellation Rate" from trips t join users u1 on u1.users_id=t.client_id a...

2021-04-08
0

Leetcode 185. 部门工资前三高的所有员工(查同组前几 经典嵌套子查询)

select d.name "Department",e.name "Employee",Salary from Employee e join Department d on e.Departmentid=d.id where (select count(distinct(e1.sa...

2021-04-01
0

Leetcode 183. 从不订购的客户(子查询、not in)

# Write your MySQL query statement belowselect Name Customers from Customers where Id not in(select c.Id from Customers c,Orders o where c.Id = o.Cu...

2021-04-01
0

Leetcode 182. 查找重复的电子邮箱 (having )

# Write your MySQL query statement belowselect Email from Person group by Email having count(Email)>1

2021-04-01
0