int* buildArray(int* nums, int numsSize, int* returnSize)
{
int i = 0;
int *ans = malloc(sizeof(int) * numsSize);
for(i = 0; i < numsSize; i++)
{
ans[i] = nums[ nums[i]];
}
*returnSize = numsSize;
return ans;
}
力扣-1920. 基于排列构建数组
最新推荐文章于 2024-09-11 22:27:08 发布