swaaaay
swaaaay
全部文章
题解
未归档(36)
归档
标签
去牛客网
登录
/
注册
swaaaay的博客
全部文章
/ 题解
(共76篇)
题解 | #构建乘积数组#
来自专栏
每次循环浅拷贝A数组切片,结果数组对应索引位置进行乘积赋值操作 class Solution: def multiply(self , A: List[int]) -> List[int]: # write code here ans=[1 for _ ...
Python3
数组
2021-11-05
2
441
题解 | #在排序数组中查找数字 I#
来自专栏
暴力解法可以做,这个题解给出另一种方法:二分法找左边界的思路 class Solution: def search(self , nums: List[int], target: int) -> int: # write code here """极端情...
Python3
数组
2021-11-05
0
569
题解 | #统计各个部门的工资记录数#
来自专栏
select d.dept_no,d.dept_name, count(s.salary) from ((departments d left join dept_emp de on d.dept_no=de.dept_no) mark left join salaries s on mark.em...
Sqlite
2021-11-03
0
307
题解 | #和为S的两个数字#
来自专栏
class Solution: def FindNumbersWithSum(self , array: List[int], sum: int) -> List[int]: # write code here left,right=0,len(arra...
Python3
2021-11-02
0
492
题解 | #斐波那契数列#
来自专栏
第0项置0,若n>=3,向列表尾部追加n-2次倒数第1,2项之和,最后返回列表最后一项 class Solution: def Fibonacci(self , n: int) -> int: # write code here ans=[0,1,...
Python3
2021-11-02
0
421
题解 | #旋转数组的最小数字#
来自专栏
# -*- coding:utf-8 -*- class Solution: def minNumberInRotateArray(self, rotateArray): # write code here if not rotateArray:return ...
Python3
双指针
2021-10-28
1
536
题解 | #数字在升序数组中出现的次数#
来自专栏
# -*- coding:utf-8 -*- class Solution: def GetNumberOfK(self, data, k): # write code here if len(data)==1: if data[0]=...
Python3
双指针
2021-10-28
0
496
题解 | #统计出当前各个title类型对应的员工当前薪水对应的平均工资#
来自专栏
select t.title title, avg(s.salary) from titles t inner join salaries s on t.emp_no=s.emp_no group by title order by avg(s.salary)
Sqlite
2021-10-27
0
354
题解 | #查找所有员工的last_name和first_name以及对应的dept_name#
来自专栏
select e.last_name,e.first_name,ifnull(dep.dept_name,null) from ((employees e left join dept_emp d on e.emp_no=d.emp_no) m left join departments dep o...
Sqlite
2021-10-27
0
387
题解 | #计算日期到天数转换#
来自专栏
闰年:能被400整除 or 能被4整除且不能被100整除 def get_ans(year,month,date): year,month,date=int(year),int(month),int(date) month_date1=[31,28,31,30,31,30,31,31...
Python3
字符串
数学
2021-10-25
4
651
首页
上一页
1
2
3
4
5
6
7
8
下一页
末页