摘要: class Solution { public: bool isValidSudoku(vector<vector<char>>& board) { int xsp[9][9] = {0}; int ysp[9][9] = {0}; int lsp[9][9] = {0}; for(int i = 阅读全文
posted @ 2020-12-08 23:11 温暖了寂寞 阅读(75) 评论(0) 推荐(0) 编辑
摘要: int* searchRange(int* nums, int numsSize, int target, int* returnSize){ int* arr = (int*)calloc(sizeof(int), 2); arr[0] = -1; arr[1] = -1; *returnSize 阅读全文
posted @ 2020-12-08 21:49 温暖了寂寞 阅读(91) 评论(0) 推荐(0) 编辑
摘要: int search(int* nums, int numsSize, int target){ int val=nums[0], i; if(target>nums[0]){ for (i=1; i<numsSize && nums[i]>nums[0]; i++) if(nums[i]==tar 阅读全文
posted @ 2020-12-08 18:48 温暖了寂寞 阅读(52) 评论(0) 推荐(0) 编辑
摘要: struct ListNode* swapPairs(struct ListNode* head) { struct ListNode dummyHead; dummyHead.next = head; struct ListNode* temp = &dummyHead; while (temp- 阅读全文
posted @ 2020-12-08 15:02 温暖了寂寞 阅读(61) 评论(0) 推荐(0) 编辑
摘要: void recursion(char** arr,char* s,int cur,int cnt,int num,int n,int* returnSize){ if (cur == n*2){ arr[(*returnSize)] = (char*)calloc(n*2 + 1, sizeof( 阅读全文
posted @ 2020-12-08 13:52 温暖了寂寞 阅读(65) 评论(0) 推荐(0) 编辑
摘要: //C快慢指针 struct ListNode* removeNthFromEnd(struct ListNode* head, int n) { struct ListNode* dummy = malloc(sizeof(struct ListNode)); dummy->val = 0, du 阅读全文
posted @ 2020-12-08 11:06 温暖了寂寞 阅读(82) 评论(0) 推荐(0) 编辑
摘要: #define MAXLEN 50 int cmp(const void* a, const void* b){ return *(int*)a - *(int*)b; } int** fourSum(int* nums, int numsSize, int target, int* returnS 阅读全文
posted @ 2020-12-08 09:55 温暖了寂寞 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 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) 编辑