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
How does it deals with singular word sentences. e.g. "Welcome"
This comment is hidden because it contains spoiler information about the solution
Wow I didn't think of reversing the string items right inside the array...
for some reason kata has error in space in the end, so I think we must create special if else for these
if space was at the end, it woudn't work correctly
Both are slow as you can just use math instead of any loop/stream.
Of course you don't NEED to iterate through. It's a really quick solution to a really quick problem, that's why it's good. The Intstream solution takes 1.3s if the input is 1 billion, but since the tests were way smaller, that ain't a problem. If coding a real project, then of course everyone should think twice if their solution is really the most efficient or not. Here it's not necessary.
Sorry
Im new here
Use spoiler flag when posting a solution like that. Otherwise it appears in the homepage discourse.
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 was the first thing i tried but im so bad at variable scoping so my code didn t work
Learned something new !
really ? "best practices" to use old fashion way "loop" instead of lambda ? welcome back to 90's....
Loading more items...