char * removeOuterParentheses(char * S){ int len = strlen(S),count=1,n=0; char* ret = (char*)calloc(len,sizeof(char*)); for (int i=1; i<len; i++) { (S ...
分类:
其他好文 时间:
2020-09-17 19:23:34
阅读次数:
21
2. 两数相加 这题medium,但思路挺简单的。模拟下就可以 /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), ...
分类:
其他好文 时间:
2020-09-17 19:08:34
阅读次数:
21
给定一个数组 nums,有一个大小为 k 的滑动窗口从数组的最左侧移动到数组的最右侧。 你只可以看到在滑动窗口内的 k 个数字。滑动窗口每次只向右移动一位。 返回滑动窗口中的最大值。 进阶: 你能在线性时间复杂度内解决此题吗? 示例: 输入: nums = [1,3,-1,-3,5,3,6,7], ...
分类:
其他好文 时间:
2020-09-17 19:01:09
阅读次数:
21
package LeetCode_758 import java.util.* import kotlin.collections.HashSet /** * 758. Bold Words in String * (Prime) * Given a set of keywords words an ...
分类:
其他好文 时间:
2020-09-17 18:53:02
阅读次数:
31
uint32_t reverseBits(uint32_t n) { int arr[32] = {0}; int i=0; while(n) { arr[i++] = n % 2; n /= 2; } for(i=0; i<32; i++) { n += (arr[i])? pow(2,32-1- ...
分类:
其他好文 时间:
2020-09-17 18:00:01
阅读次数:
18
void reverseString(char* s, int sSize){ int start =0,end = sSize-1,temp; while(start < end) temp = s[start],s[start++] = s[end],s[end--] = temp; } ...
分类:
其他好文 时间:
2020-09-17 17:36:43
阅读次数:
24
17. 电话号码的字母组合 排列题目,很容易想到回溯。下面是ac代码。 class Solution { private: vector<string> vstrs = {"","","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"}; public ...
分类:
其他好文 时间:
2020-09-17 17:29:41
阅读次数:
23
int romanToInt(char * s){ int* hash = (int*)calloc(26,sizeof(int)); hash['I'-65] = 1; hash['V'-65] = 5; hash['X'-65] = 10; hash['L'-65] = 50; hash['C' ...
分类:
其他好文 时间:
2020-09-17 17:09:44
阅读次数:
20
int** shiftGrid(int** grid, int gridSize, int* gridColSize, int k, int* returnSize, int** returnColumnSizes){ int** arr = (int**)calloc(gridSize,sizeo ...
分类:
其他好文 时间:
2020-09-17 16:19:10
阅读次数:
24
Dangling meta character '?' near index 0 报错修改,将 "?" 改成 "[?]" 10^9 + 7取余 (a% (1e9+7)) * (b% (1e9 +7)) %(1e9 +7) // a * b ...
分类:
其他好文 时间:
2020-09-17 16:07:59
阅读次数:
25