王钲超
王钲超
全部文章
题解
归档
标签
去牛客网
登录
/
注册
王钲超的博客
全部文章
/ 题解
(共13篇)
SQL91 获得积分最多的人(三)
用case when讲grade改成带正负的 2. groupby id + sum() 3. dense_rank = 1select id, name, grade_sum from (SELECT t2.user_id as id, t3.name as name, t2.sum2 as g...
2021-08-02
0
550
题解 | #子数组最大乘积# PYTHON3 动态规划O(N)
# # # @param arr double浮点型一维数组 # @return double浮点型 # class Solution: def maxProduct(self , arr ): # write code here global_max =...
2021-07-30
0
395
题解 | #岛屿数量#python3 普通的递归dfs
#坑就是grid里的元素时字符串形式.. class Solution: def solve(self , grid ): # write code here record = [[0 for e in sublist] for sublist in grid...
2021-07-28
0
411
题解 | #股票(无限次交易)#
每遍历到一个价格: 如果可以赚,就卖掉,并存入账户;如果不赚,就假装前一次没有买入 买入 class Solution: def maxProfit(self , prices ): # write code here c = 0 last...
2021-07-27
0
486
题解 | #最小的K个数#python三种方法实现sort、heap、partition
# -*- coding:utf-8 -*- import heapq #利用heapq实现一个大根堆 def heapify(x): for i in range(len(x)): x[i] = -x[i] heapq.heapify(x) def heappus...
2021-07-26
0
426
题解 | #子数组的最大累加和问题#
class Solution: def maxsumofSubarray(self , arr ): # write code here global_max = 0 max_cache = 0 for i in arr: ...
2021-07-25
0
381
查找描述信息中包括robot的电影对应的分类名称以及电影数目
select category.name as "分类名称category.name",count(*) as "电影数目count(film.film_id)"from film left join film_category on film.film_id = film_category.f...
2020-08-18
0
597
给出每个员工每年薪水涨幅超过5000的员工
select s1.emp_no, s1.from_date, (s1.salary - s2.salary) as salary_growthfrom salaries s1, salaries s2where s1.emp_no = s2.emp_no and s1.from_date = s2...
2020-08-18
0
612
获取员工其当前的薪水比其manager当前薪水还高的相关信息
select t2.emp_no, t2.manager_no, t2.emp_salary, salaries.salary as manager_salary from (select t1.emp_no as emp_no, dept_manager.emp_no as manager_no...
2020-08-17
0
711
统计出当前各个title类型对应的员工当前薪水对应的平均工资
select titles.title, avg(salaries.salary) as avgfrom salaries, titleswhere titles.to_date='9999-01-01' and salaries.to_date='9999-01-01'and salaries....
2020-08-12
0
647
首页
上一页
1
2
下一页
末页