你说夕阳很美
你说夕阳很美
全部文章
题解
归档
标签
去牛客网
登录
/
注册
你说夕阳很美的博客
全部文章
/ 题解
(共152篇)
题解 | #和为K的连续子数组#
class Solution { public: /** * max length of the subarray sum = k * @param arr int整型vector the array * @param k int整型 target *...
C++
2021-12-16
0
374
题解 | #完全二叉树结点数#
/** struct TreeNode { int val; struct TreeNode *left; struct TreeNode *right; TreeNode(int x) : val(x), left(NULL), right(...
C++
2021-12-14
0
501
题解 | #丑数#
class Solution { public: int GetUglyNumber_Solution(int index) { // 动态规划 vector<int> dp(index + 1); dp[1] = 1; ...
C++
2021-12-13
0
423
题解 | #丑数#
class Solution { public: int GetUglyNumber_Solution(int index) { int factors[] = {2, 3, 5}; unordered_set<long> hash; // 哈希表...
C++
2021-12-13
0
335
题解 | #数字在升序数组中出现的次数#
class Solution { public: int GetNumberOfK(vector<int> data ,int k) { if(data.size() < 1) return 0; int l = 0,...
C++
2021-12-09
0
300
题解 | #旋转数组的最小数字#
class Solution { public: int minNumberInRotateArray(vector<int> rotateArray) { int l = 0, r = rotateArray.size() - 1; // 二分法...
C++
2021-12-09
0
305
题解 | #孩子们的游戏(圆圈中最后剩下的数)#
class Solution { public: int LastRemaining_Solution(int n, int m) { if(n <= 0) return -1; // 当n==1时返回0 // f(n...
C++
2021-12-08
0
299
题解 | #第一个只出现一次的字符#
class Solution { public: int FirstNotRepeatingChar(string str) { map<int, int> mp; int res = -1; for(int i = 0; i &l...
C++
2021-12-07
0
282
题解 | #扑克牌顺子#
class Solution { public: bool IsContinuous( vector<int> numbers ) { int flag = 0; // 保存整数,扑克牌大小[0, 13],而int位数有32个,使用int的低13位来判断是否出现...
C++
2021-12-06
0
351
题解 | #扑克牌顺子#
class Solution { public: bool IsContinuous( vector<int> numbers ) { sort(numbers.begin(), numbers.end()); int jokerNumber = ...
C++
2021-12-06
0
323
首页
上一页
1
2
3
4
5
6
7
8
9
10
下一页
末页