浮狸
浮狸
全部文章
分类
题解(8)
归档
标签
去牛客网
登录
/
注册
浮狸的博客
全部文章
(共8篇)
利用最大堆最小堆方式求解K个数问题
# -*- coding:utf-8 -*- class Solution: def GetLeastNumbers_Solution(self, tinput, k): # write code here # lentinput = len(tinput) ...
2021-07-29
0
370
题解:树的子结构
# -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None cl...
2021-06-22
0
347
重建二叉树
# -*- coding:utf-8 -*- # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None cl...
2021-06-22
0
320
题解 | #数组中只出现一次的两个数字#
# way 0 class Solution: def FindNumsAppearOnce(self , array ): &nbs...
2021-06-21
0
373
题解 | #丑数#
# way 1 复杂度过高 class Solution: def GetUglyNumber_Solution(self, index): # write code here if index < 1: return None ...
2021-06-21
0
313
题解 | #整数中1出现的次数(从1到n整数中1出现的次数)#
# way 1 # -*- coding:utf-8 -*- class Solution: def NumberOf1Between1AndN_Solution(self, n): # write code here # -*- coding:utf-8 -...
2021-06-20
0
374
题解 | #数组中出现次数超过一半的数字#
# -*- coding:utf-8 -*- class Solution: def MoreThanHalfNum_Solution(self, numbers): # write code here # way 0 lennumbers =...
2021-06-18
0
360
题解 | #二进制中1的个数#
class Solution: def NumberOf1(self, n): # write code here # 补码:正数不变,负数是它的正数的反码加一 # n & 0xFFFFFFFF # way 1 ...
2021-06-16
0
341