首页
题库
面试
求职
课程
竞赛
More+
所有博客
搜索面经/职位/试题/公司
搜索
我要招人
去企业版
登录 / 注册
nbgao
杭州电子科技大学
2022届
Java工程师
Studying & Thinking
关注
私信
加入黑名单
举报TA
TA的博客
首页
刷题
圈子
项目
笔记
基本资料
真题试卷
在线编程
心理测试
回答的问题(1058)
买卖股票的最好时机 iii
1
class Solution { public: int maxProfit(vector<int> &prices) { int b1 = INT_MIN, s1 = 0, b2 = INT_MIN, s2 = 0; for(int p:...
发表于 2017-09-03 01:27:00
实现阶乘
1
class Solution { public: double pow(double x, int n) { if(x == 0) return 0; if(n == 0) return 1; double result = 1; ...
发表于 2017-09-03 01:07:37
最长的连续元素序列长度
2
class Solution { public: int longestConsecutive(vector<int> &num) { set<int> Set(num.begin(),num.end()); int resul...
发表于 2017-09-02 01:20:46
二级制求和
7
class Solution { public: string addBinary(string a, string b) { int l1=a.length()-1,l2=b.length()-1; string sum = ""; ...
发表于 2017-09-02 00:55:14
从中序和后序遍历构造二叉树
1
class Solution { public: TreeNode *buildTree(vector<int> &inorder, vector<int> &postorder) { int l_in = inorder.size()...
发表于 2017-09-01 02:02:00
删除元素
2
class Solution { public: int removeElement(int A[], int n, int elem) { for(int i=0;i<n;i++) { if(A[i] == elem) ...
发表于 2017-09-01 01:33:22
判断二叉搜索树
3
class Solution { public: bool isValidBST(TreeNode *root) { return solve(root,INT_MIN,INT_MAX); } bool solve(TreeNode *root,int l,i...
发表于 2017-08-31 02:48:29
将升序数组转化为平衡二叉搜索树
1
class Solution { public: TreeNode *sortedArrayToBST(vector<int> &num) { return ArrayToBST(num,0,num.size()); } TreeNode ...
发表于 2017-08-31 02:25:30
搅乱字符串
19
class Solution { public: bool isScramble(string s1, string s2) { if(s1 == s2) return true; int c[26] = {0}; for(i...
发表于 2017-08-30 01:20:45
加起来和为目标值的组合(二)
1
class Solution { vector<int> d; vector<vector<int> > result; set<vector<int> > s; public: vector<vector<int...
发表于 2017-08-30 00:57:40
首页
上一页
94
95
96
97
98
99
100
101
下一页
末页
扫描二维码,关注牛客网
意见反馈
下载牛客APP,随时随地刷题