Created
October 14, 2020 21:06
-
-
Save halirutan/58c5d17435d15d26fc818b7b0e6f2e41 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
/** | |
* 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** threeSum(int* nums, int numsSize, int* returnSize, int** returnColumnSizes){ | |
*returnSize = 1; | |
*returnColumnSizes = (int*) malloc(1* sizeof(int)); | |
*returnColumnSizes[0] = 3; | |
int **result = (int **) malloc(1 * sizeof(int *)); | |
int *sol1 = (int *) malloc(3* sizeof(int)); | |
sol1[0] = 1; | |
sol1[1] = 2; | |
sol1[2] = 3; | |
result[0] = sol1; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment