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.
Thanks! This was very helpful for me.
1+2=3 (1th triangular number)
1+2+3=6 (2dn triangular number)
1+2+3+4=10 (3d triangular number)
1+2+3+4+5=15 (4th triangular number)
1+2+3+4+5+6=21 (5th triangular number)
1+2+...+13+14 = 105 (13th triangular number)
given n, return the sum of the triangular numbers 1 to n.
n=2 gives 3+6=9.
Vasya doesn't do that, and you shouldn't either.
in my code its also failed, all the other test passed exept this one.
I am so confused as to what to do after reading the descritpion. Could someone elaborate please?
There're already lots of messages about this. You should use math, not loops.
And yet you're adding an backhanded insult to someone in pretty much an attempt to save face. If he deserves 1 dick point you deserve 100.
I know lots of newbies have ego issues, needs others to cater them and give them participation awards to feel better about themselves. But let's be honest, if you're wrong, you're wrong, and doing half-assed backhanded insults like this will only make you more unlikable ;-)
Counting them one by one is too slow. Ideally you shouldn't even need to count ;-)
This comment is hidden because it contains spoiler information about the solution
You can do this in Haskell easily without a timeout, how you filter them is the critical part.
For example how would you do this in Haskell :
-generate all the numbers from 1 to 50 bazillion
-filter the numbers which are equal to 69
-return the remaining list
A lot of the final tests are more rigerous than the initial and often have performance requirements.
Same! I thought it was just me?
Add a
perfomance
label to the kata so users are warned about it being a requirement. Right now,puzzle
is ignored it seems.Or better yet do that and also write about it in the instructions, given it's an 8 kyu kata some people would think iterative solutions should work.
Yes, and that's not a kata issue, it's a problem with your code, use
Question
for cases like this one.This comment is hidden because it contains spoiler information about the solution
Loading more items...