Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
int largest_five_digits(char *digits)
{
int length = sizeof(digits) + 2;
int gDigits[length], i;
int max = 0, maxI, maxDigit[5];
for(i = 0; i < length; i++)
{
gDigits[i] = digits[i];
}
for(i = 0; i < length - 4; i++)
{
if(gDigits[i] > max)
{
max = gDigits[i];
maxI = i;
}
}
for(i = 0; i < length - 4; i++)
{
maxDigit[i] = gDigits[maxI + i];
}
return maxDigit; // you code here
}
Sorry for this kind of question!
I find the solution, but i can't return it.
This comment is hidden because it contains spoiler information about the solution
when i tested my code i had got following error. Why?
solution.c:1:1: error: unknown type name 'y_'
y_
^
In file included from solution.c:2:
In file included from /usr/lib/llvm-8/lib/clang/8.0.1/include/stdint.h:61:
In file included from /usr/include/stdint.h:27:
/usr/include/x86_64-linux-gnu/bits/types.h:30:1: error: expected identifier or '('
typedef unsigned char __u_char;
^
2 errors generated.
I couldn't understand well your code in line 6. Please, give me some comments or explanations if you can!
This comment is hidden because it contains spoiler information about the solution
when i tested my code i passed but when i tried to submit it it failed. Why?