摘要: #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) 编辑