杨舜文
杨舜文
全部文章
分类
题解(113)
归档
标签
去牛客网
登录
/
注册
杨舜文的博客
全部文章
(共98篇)
题解 | #最小的K个数#
# # # @param arr int整型一维数组 the array # @return int整型 # class Solution: def maxLength(self , arr ): # write code here li = [] ...
2021-08-15
0
241
题解 | #最小的K个数#
class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { sort(input.begin(), input.end()); ...
2021-08-15
0
309
题解 | #最小的K个数#
# -*- coding:utf-8 -*- class Solution: def GetLeastNumbers_Solution(self, tinput, k): # write code here tinput.sort() retu...
2021-08-15
0
256
题解 | #跳台阶#
# -*- coding:utf-8 -*- class Solution: def jumpFloor(self, number): # write code here if number <= 2: return number n1 ...
2021-08-15
0
241
题解 | #跳台阶#
class Solution { public: int jumpFloor(int n) { if (n <= 2) return n; int n1 = 1, n2 = 2, n3 = 0; for (int i = 3; i <...
2021-08-15
0
390
题解 | #用两个栈实现队列#
# -*- coding:utf-8 -*- class Solution: def __init__(self): self.stack1 = [] def push(self, node): self.stack1.append(node) ...
2021-08-15
0
317
题解 | #用两个栈实现队列#
class Solution { public: void push(int node) { stack1.push(node); } int pop() { if (stack2.empty()) { while(!...
2021-08-15
0
187
题解 | #求二叉树的层序遍历#
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
2021-08-15
0
313
题解 | #求二叉树的层序遍历#
# class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # # # @param root TreeN...
2021-08-14
0
296
题解 | #二分查找-II#
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # 如果目标值存在返回下标,否则返回 -1 # @param nums int整型一维数组 # @param target int整型 # @return int整型 # class Solution: ...
2021-08-14
0
301
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页