Write a C function
int best argset(int n, int *argc, char ***argv)
best argset function returns the index of one argument set with the highest number of characters. An
array of arguments is defined in the same memory format as the C main function int argc, char **argv, where argc is a single integer representing the number of arguments and argv is the array of C strings. This is known as the argument set.
best argset function accepts an array of argument sets, where n is the number of argument sets, argc
is an array of integers, argv is an array of an array of C strings. The argument set with the highest number of characters has an index from the input. This index is the return value of the function.
On success, the index of the argument set with the highest number of characters is returned. If there is
more than one argument set discovered to have the highest, only one is returned and it can be any. -1 is returned if any parameter is NULL, or n is less than or equal to zero.
Example of input data and return value:
index argc[index] argv[index][0] argv[index][1] argv[index][2]
0 3 ”abc” ”def” ”ghi”
1 1 ”ruck rover”
2 3 ”./a.out” ”launch” ”5”
Returns 2
The following function may be useful:
size t strlen(const char *str);
The function strlen() calculates the length of the string pointed to by str, excluding the terminating null byte.