摘要: 力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台 /** * Note: The returned array must be malloced, assume caller calls free(). */ int* intersection(int* nums1, int nums1 阅读全文
posted @ 2023-09-25 16:23 朵朵奇fa 阅读(57) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include<stdio.h> int main() { int nums[] = { 1,1,2,2,3,4,5,6,6 }; int size = sizeof(nums) / sizeof(nums[0]); // 创建一个全0的空数组 int* c 阅读全文
posted @ 2023-09-25 14:48 朵朵奇fa 阅读(337) 评论(0) 推荐(0) 编辑
摘要: 26. 删除有序数组中的重复项 - 力扣(LeetCode) int checkIn(int* nums, int numsSize, int target) { for (int i = 0; i < numsSize; i++) { if (nums[i] == target) { return 阅读全文
posted @ 2023-09-25 10:52 朵朵奇fa 阅读(12) 评论(0) 推荐(0) 编辑
摘要: #include <iostream> #include<stdio.h> int* removeDuplicates(int numsSize) { // malloc是常用的动态内存分配 int* arr = (int*)malloc(numsSize * sizeof(int)); retur 阅读全文
posted @ 2023-09-25 09:36 朵朵奇fa 阅读(5) 评论(0) 推荐(0) 编辑