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
list comprehensions are faster than lambda expressions, great...
this should be the first upvoted, if users just took a while to see why it is 2 lines not 1.
brute force was voted more then this solution lol. This should go up^^!
:D :D :D
S - is the sum of a square's sides, than that sum (S) is multiplied by 4 and as a result you get a perimeter of squares.
So S(n) - is a length of nth square side.
And you need to write a function that will calculte 4 * S = 4 * ( S(0) + S(1) + .... + S(n) )
An IntStream. See https://docs.oracle.com/javase/8/docs/api/java/lang/CharSequence.html#chars--
Can someone explain this for me?
Say that S(n) is the nth term of the above sum. So S(0) = 1, S(1) = 1, S(2) = 2, ... , S(5) = 8
What does it mean nth term of the above sum, I understand it in a way that S(5) is the sum of perimeters of 5 such rectangles.
this is java-8, do they support java 8?
This comment is hidden because it contains spoiler information about the solution
nice one
This comment is hidden because it contains spoiler information about the solution
no problem super smart guy
Thank you! My fans
you are so clever Gigi, im astonished