how to return returnColumnSizes in several similar problems

I encountered several questions all need to return returnSize and returnColumnSizes. I don't quite understand what these two parameters stand for. The given example doesn't explain the usage of them. Anyone who already solved these kind of questions please help to provide an explanation. Many thanks! For example, in the following question and given example, I think *returnSize should be 3. But what should returnColumnSizes contain?

Problem 18: 4Sum
Medium

Given an array nums of n integers and an integer target, are there elements a, b, c, and d in nums such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.

Note:

The solution set must not contain duplicate quadruplets.

Example:

Given array nums = [1, 0, -1, 0, -2, 2], and target = 0.

A solution set is:
[
[-1, 0, 0, 1],
[-2, -1, 1, 2],
[-2, 0, 0, 2]
]

/**
 * Return an array of arrays of size *returnSize.
 * The sizes of the arrays are returned as *returnColumnSizes array.
 * Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().
 */
int** fourSum(int* nums, int numsSize, int target, int* returnSize, int** returnColumnSizes){

}
Comments (0)