辣椒酱up
辣椒酱up
全部文章
分类
归档
标签
去牛客网
登录
/
注册
辣椒酱up的博客
全部文章
(共60篇)
题解 | #二分查找-II#
class Solution { public: int search(vector<int>& nums, int target) { // write code here int n = nums.size(); i...
2024-03-08
0
189
题解 | #比较版本号#
class Solution { public: //这里要注意点有 1.用字符串转int,使用方法stio会超内存 // 2.字符串的比较,用大于小于的话,,默认字典集,也就是依次从左往右进行比较,当遇到大的就直接返回 int compare(string v...
2024-03-08
0
203
题解 | #比较版本号#
//题目说不会超界,其实会 #include<cstring> class Solution { public: int compare(string version1, string version2) { //只需要比较几个点号 //考...
2024-03-08
0
178
题解 | #压缩字符串(一)#
#include <string> class Solution { public: string compressString(string param) { // write code here string ans; int ...
2024-03-08
0
178
题解 | #包含min函数的栈#
#define MAXSIZE 300 class Solution { private: int * arr = new int[300]; int t = 0; public: void push(int value) { if(t == 300) ...
2024-03-07
0
151
题解 | #矩阵元素查找#
class Solution { public: vector<int> findElement(vector<vector<int> >& mat, int n, int m, int x) { vector<in...
2024-03-06
0
175
题解 | #拼接所有的字符串产生字典序最小的字符串#
class Solution { public: static bool cmp(string a, string b){ // return (a + b) < (b + a); //表示b + a 更大就返回1,表示把b放在前面 if((a ...
2024-03-06
0
182
题解 | #连续子数组的最大乘积#
#include <algorithm> #include <vector> class Solution { public: //我觉得这题最离谱的是数据量好大 int maxProduct(vector<int>& nums) { ...
2024-03-05
0
205
题解 | #丑数#
#include <vector> class Solution { public: int GetUglyNumber_Solution(int index) { if(!index) return 0; //只包含质因数为2、3、...
2024-03-05
0
220
题解 | #调整数组顺序使奇数位于偶数前面(一)#
class Solution { public: vector<int> reOrderArray(vector<int>& array) { int n = array.size(); vector...
2024-03-05
0
159
首页
上一页
1
2
3
4
5
6
下一页
末页