十一月的may
十一月的may
全部文章
分类
题解(37)
归档
标签
去牛客网
登录
/
注册
枫的博客
全部文章
(共35篇)
题解 | #大数加法#
string solve(string s, string t) { string result=""; int flag=0;//进位标志 int i=s.length()-1,j=t.length()-1; wh...
2021-08-19
0
570
题解 | #买卖股票的最好时机#
class Solution { public: /** * * @param prices int整型vector * @return int整型 */ int maxProfit(vector<int>& price...
2021-08-19
0
552
题解 | #两个链表生成相加链表#
class Solution { public: /** * * @param head1 ListNode类 * @param head2 ListNode类 * @return ListNode类 */ ListNode* ...
2021-08-19
0
386
题解 | #二叉树根节点到叶子节点和为指定值的路径#
class Solution { public: /** * * @param root TreeNode类 * @param sum int整型 * @return int整型vector<vector<>> ...
2021-08-19
0
472
题解 | #表达式求值#
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * 返回表达式的值 * @param s string字符串 待计算的表达式 * @return int整型 ...
C++
2021-08-19
7
846
题解 | #最长回文子串#
class Solution { public: int getLongestPalindrome(string A, int n) { int m=1; for(int i=0; i<n; i++) for(int j=n-1;...
2021-08-18
0
435
题解 | #子数组的最大累加和问题#
class Solution { public: /** * max sum of the subarray * @param arr int整型vector the array * @return int整型 */ int maxsumofS...
2021-08-18
0
405
题解 | #寻找第K大#
class Solution { public: int findKth(vector<int> a, int n, int K) { quicksort(a,0,n-1,K); return a[K-1]; } int parti...
2021-08-18
0
440
题解 | #合并两个有序的数组#
class Solution { public: void merge(int A[], int m, int B[], int n) { /*//直接插入排序 int i=0,j=0; while(j<n) { ...
2021-08-18
0
452
题解 | #最小的K个数#
class Solution { public: int partition(vector<int> & input, int left, int right) { int tmp=input[left]; while(left&l...
2021-08-17
0
465
首页
上一页
1
2
3
4
下一页
末页