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.
If your expecting your arrays to be smaller than it would be much more practical to just use the Sort method from Array. However if you're dealing with an array containing 10^6 elements this method is 25x faster than using sort!
while writing code with sorting much easier, sorting is quite costly. you should try avoid using it unless can't do otherwise or actualy need whole thing sorted.
Creative way of getting the lowest two values! However,
Array.Sort(array);
is much easier. Nice job regardless!Remove unneccesary line
int modulus = eggs % 8;
and include the modulus in your if statement:You can shorten the code with
time += 5;
Great job! You had a much more concise version of my solution.Expected 9
is incorrect. Your code is working correctly.Raise the second-to-last value to the power of the last value:
2^0 = 1 (anything raised to the power of 0 is one)
Then raise the first number of the array (3) to the power of the result of the previous expression(s):
3^1 = 3
The test case solutions are wrong.