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.
I can follow this now. It's interesting to come back to this 7 years later, it makes much more sense to me now.
This comment is hidden because it contains spoiler information about the solution
One line. Excellent!
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
I used almost the same approach, passed tests under Attempt button and was happy it's done.
Yes, I thought about "what if first element will be default?"
The answer depends on environment we work in:
You may just return false withut var rez. And in if construction return true
This comment is hidden because it contains spoiler information about the solution
watafuk bro
Just when I thought that one line is impossible.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Same
The rez variable is unnecessary here. Your solution can be presented in a simpler way:
int sum1 = 0;
int sum2 = 0;
for (int i = 0; i < arr1.Length; i++)
{
sum1 += arr1[i];
}
for (int i = 0; i < arr2.Length; i++)
{
sum2 += arr2[i];
}
return sum1 + sum2;
Loading more items...