上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 63 下一页
摘要: void recursion(char * digits, int* returnSize,char** arr,char** map,int cur,char* s,int len){ if (cur >= len){ arr[(*returnSize)] = (char*)calloc(len 阅读全文
posted @ 2020-12-08 09:26 温暖了寂寞 阅读(134) 评论(0) 推荐(0) 编辑
摘要: #define INT_MAX 2147483647 int cmp(const void* a, const void* b){ return *(int*)a - *(int*)b; // 快排构造递增序列 } int threeSumClosest(int* nums, int numsSiz 阅读全文
posted @ 2020-12-07 23:22 温暖了寂寞 阅读(75) 评论(0) 推荐(0) 编辑
摘要: int CompareByIncrease(const void* a, const void* b){ return *(int*)a - *(int*)b; // 快排构造递增序列 } int** threeSum(int* nums, int numsSize, int* returnSize 阅读全文
posted @ 2020-12-07 19:33 温暖了寂寞 阅读(108) 评论(0) 推荐(0) 编辑
摘要: /*JAVA*/ int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; String[] symbols = {"M","CM","D","CD","C","XC","L","XL","X","IX","V"," 阅读全文
posted @ 2020-12-07 15:48 温暖了寂寞 阅读(71) 评论(0) 推荐(0) 编辑
摘要: /*C++双指针*/ class Solution { public: int maxArea(vector<int>& height) { int l = 0, r = height.size() - 1; int ans = 0; while (l < r) { int area = min(h 阅读全文
posted @ 2020-12-07 13:33 温暖了寂寞 阅读(57) 评论(0) 推荐(0) 编辑
摘要: /* 方法2 */ int myAtoi(char *str) { long n = 0; int sign = 0; /* 跳过空格 */ while (*str == ' ') ++str; /* 判断符号 */ if(*str == '-' || *str == '+') { sign = ( 阅读全文
posted @ 2020-12-07 10:27 温暖了寂寞 阅读(90) 评论(0) 推荐(0) 编辑
摘要: char * convert(char * s, int numRows){ if (numRows < 2) return s; int i, j, pst = 0, len = strlen(s), cnt; char* retStr = (char*)calloc(len + 1, sizeo 阅读全文
posted @ 2020-12-07 00:20 温暖了寂寞 阅读(74) 评论(0) 推荐(0) 编辑
摘要: /*Manacher 算法*/ #include <iostream> #include <string> #include <vector> using namespace std; class Solution { public: string longestPalindrome(string 阅读全文
posted @ 2020-12-06 21:54 温暖了寂寞 阅读(109) 评论(0) 推荐(0) 编辑
摘要: int minimumOperations(char* leaves) { int n = strlen(leaves); int f[n][3]; f[0][0] = (leaves[0] == 'y'); f[0][1] = f[0][2] = f[1][2] = INT_MAX; for (i 阅读全文
posted @ 2020-12-05 22:44 温暖了寂寞 阅读(68) 评论(0) 推荐(0) 编辑
摘要: int lengthOfLongestSubstring(char * s){ int i, j = 0, count = 0, max = 0, index[128] = { 0 }, start = 0; for (i = 0; s[i] != '\0'; i++) { if (index[s[ 阅读全文
posted @ 2020-12-05 22:43 温暖了寂寞 阅读(41) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 63 下一页