LEET CODE TWO SUM PROBLEM ERROR

Hey, I was practicing some questions on leetcode when I encountered the TWO SUM problem. The task was to write a function and find the index of two elements whose sum is a given number. However upon running the code I am getting the error that the called fuction has too many arguments. The function and error message are below:
Code :

/**
 * Note: The returned array must be malloced, assume caller calls free().
 */
int* twoSum(int* nums, int numsSize, int target) {
    
    int i;
    int j;
    int req;
    int flag=0;
    int *arr= (int *)malloc(2*sizeof(int));
    
    for(i=0; i<numsSize; i++)
    {
        req= target- *(nums+i);
        for(j=i+1;j<numsSize;j++)
        {
            if(*(nums+j)== req)
            {
                *arr= i;
                *(arr+1)= j;
                flag=1;
                break;
            }
        }
        if(flag==1)
            break;
    }
    return arr;
}

Error Message :

Line 73: Char 20: error: too many arguments to function 'twoSum'

Can anyone tell me how to submit the code because the main function is not written by me its controlled by leetcode's editor itself and moreover the number of arguments to the twoSum function were already provided and I have not altered anything in the parameters list.

Your help would really be appreciated.
Thankyou

Comments (1)