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 could allow special numeric characters such as ¾ to be removed. See isnumeric documentation.
In Julia this is a one liner. 7kyu would be a better choice.
There is a equation for the sum of the squares. Finding the root of this equation would find you the answer, but you would need to find the root of a cubic equation. m(m+1)(2m+1)/6 = sum of squares (1^2+2^2+3^2....m^2)
isletter will also find letters like alpha and beta as true.
Generic solution!
With the Julia version I get unordered tests arrays:
ary = [1, -4, -1, 1, -5, 5, -4, -2] and val = 3
8balls is just a little shorter ;)
This is not the best practice, because Julia has a partialsort function, which is more efficient.
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
Splitting twice?
Is it the most efficient method? At worst you need to sum the complete array length(arr) times. In principle you only need to take the previous answer and add or substract a single item with each step.