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.
tbh it took me around 2 months ish cuz like i solved problems for like 90 ish minutes a day when i started i was so buns ngl but rn i can solve 6 kyu problems and sometimes 5 i can't solve 4 kyu ones yet :) i say keep grinding
finally, my solution matches the highest ranked solution
off topic (and idk where i can dm you) but how long did it take you to get to 4 kyu from 8 kyu ?
That's exactly what is being done, omitting the return keyword is just a common shorthand for 1 liner arrow functions
hm... didn't think that such a simple pattern would work. but okay i guess.
ts so smart i love ts ❤️
I am hella scared of lamda.
thank you for your suggestion :) (mine looks same as him)
this kata is more than 10 years old. Classes were introduced in ES2015. (by the way, classes are no longer merely syntactic sugar for prototypal objects; private class features for instance can hardly be emulated with pre-ES2015 JavaScript)
why not use a class? I get that a class is just syntactical sugar and it's doing this under the hood but why do it like this?
I'll say, but keep in mind that this approach is more concise and efficient than your method, especially for larger numbers.
Wow... that's insane
Good one with the prototype. but if the object will be created with the class, the prototype is created automatically.
You are right. I know you are not supposed to 'invent the wheel again' but this exercise is great to learn algorithmic thinking and complex concepts like recursion.
I think it's better to use this space to do what you wanted to do at first. This is a great exercise to understand and practice algorithms and recursion
Loading more items...