首页
题库
面试
求职
学习
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
牛客107898号
Stanford University
2020届
算法工程师
关注
私信
加入黑名单
举报TA
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(49)
01背包
1
import sys input = [] for line in sys.stdin: input.append(line.strip().split()) volumn = int(input[0][0]) weights = [int(x[0]) for x in input[1:]...
发表于 2019-09-21 16:17:17
左旋转字符串
0
# -*- coding:utf-8 -*- class Solution: def LeftRotateString(self, s, n): # write code here if s == '': return s n %= len(s...
发表于 2019-09-18 11:56:00
数组中只出现一次的数字
0
class Solution: # 返回[a,b] 其中ab是出现一次的两个数字 def FindNumsAppearOnce(self, array): # write code here nums = [] for num in a...
发表于 2019-09-18 10:48:49
判断是不是平衡二叉树
0
class Solution: def IsBalanced_Solution(self, pRoot): # write code here stack = [] result = [True] if pRoot is Non...
发表于 2019-09-18 10:37:26
二叉树的深度
0
class Solution: def TreeDepth(self, pRoot): stack = [] if pRoot is None: return 0 def helper(root): if root is...
发表于 2019-09-18 10:28:17
数字在升序数组中出现的次数
0
# -*- coding:utf-8 -*- class Solution: def GetNumberOfK(self, data, k): # write code here return data.count(k) ???满头大汉的python代码
发表于 2019-09-17 23:39:26
数组中的逆序对
0
# -*- coding:utf-8 -*- class Solution: def InversePairs(self, data): # write code here count = [0] def sort(data, low, hig...
发表于 2019-09-17 23:26:32
丑数
0
# -*- coding:utf-8 -*- class Solution: def GetUglyNumber_Solution(self, index): if index <= 6: return index p2 = 0; p3 = 0; p5 ...
发表于 2019-09-17 10:49:54
把数组排成最小的数
0
class Solution: def PrintMinNumber(self, numbers): if len(numbers) == 0: return '' numbers = [str(number) for number in numbers] ...
发表于 2019-09-13 20:58:37
最小的K个数
0
class Solution: def GetLeastNumbers_Solution(self, tinput, k): return sorted(tinput)[:k] if k <= len(tinput) else [] 对不起。。。 ...
发表于 2019-09-13 12:36:46
首页
上一页
1
2
3
4
5
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题