swaaaay
swaaaay
全部文章
分类
未归档(36)
题解(78)
归档
标签
去牛客网
登录
/
注册
swaaaay的博客
TA的专栏
112篇文章
4人订阅
题解-数据结构与算法
47篇文章
689人学习
题解-SQL
29篇文章
489人学习
每天一道面试题
36篇文章
1432人学习
全部文章
(共112篇)
题解 | #统计每个月兔子的总数#
来自专栏
python实现斐波那契数列 def get_ans(s): ans=[0,1,1] if s<=2: return ans[s] for i in range(3,s+1): ans.append(ans[i-1]+ans[i-2]) ...
Python3
2021-11-11
0
313
题解 | #使用join查询方式找出没有分类的电影id以及名称#
来自专栏
select f.film_id, f.title from film f left join film_category fc on f.film_id=fc.film_id left join category c on fc.category_id=c.category_id where c...
Sqlite
2021-11-10
0
400
题解 | #求最大连续bit数#
来自专栏
非常暴力的解法,每遇到一个1则res+1,每遇到一个0则res=0,列表记录res的值,最后返回max(列表) def get_ans(s): ans=[] res=0 mark=str(bin(int(s))) for i in mark: if i...
Python3
2021-11-09
1
480
题解 | #二叉树中和为某一值的路径(一)#
来自专栏
python递归 class Solution: def hasPathSum(self , root: TreeNode, sum: int) -> bool: # write code here if not root: return False ...
Python3
二叉树
递归
2021-11-08
0
349
题解 | #把二叉树打印成多行#
来自专栏
二叉树好难。。。 class Solution: # 返回二维列表[[1,2],[4,5]] def Print(self, pRoot): # write code here if not pRoot:return [] result...
Python3
二叉树
2021-11-08
0
418
题解 | #合并两个排序的链表#
来自专栏
class Solution: def Merge(self, pHead1, pHead2): # write code here cur1,cur2=pHead1,pHead2 '''极端情况''' if not cur1:...
Python3
2021-11-05
1
398
题解 | #构建乘积数组#
来自专栏
每次循环浅拷贝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
首页
上一页
3
4
5
6
7
8
9
10
11
12
下一页
末页