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.
I can agree...really struggled on this one. But curious how other did it
Hey RrNn, any luck figuring out the decrypt function? I'd appreciate it if you had any input; I'm stumped, especially with the part with the last for loop
Thank you, putting it through the tests pointed out a flaw in my code that I had to add a conditional for.
Node 14 is now supported :)
Discourse page is not a proper place to save your solutions. If you need to save some code on Codewars, you can make a kumite (top right menu >
New Kumite
).*I deleted my node 14 JS solution and put it into a kumite which I assume anyone can access. If anyone wants to let me know if my solution has any glaring flaws and/or point me in the direction of how to modify it to not use BigInt(or let me know if it's a waste of time to learn old stuff), I'd appreciate it.
Solved it with BigInt (didn't realize it was old version and don't know how to upgrade node version but if someone/I eventually does, I wanted to save my solution here). Someone feel free to send some imaginary honor points to me. I will give you an imaginary high five.
I agree that at a certain point, I/anyone should and often do realize that there is a simpler/more efficient/easier to understand solution than tons of conditionals which is why I refer to my code as 'worst practices'. I am just often not at the point in my learning journey where those simpler solutions are in my brain 'arsenal' but hopefully someday.
Whenever you find yourself adding 100s of conditions for any problem (not just this one) then probably it is time to pause and consider if there might be another simpler way to do it.
Go translation
This post is for others like me who normally can do 6's, occasionally 5's, and very rarely a 4kyu. This one is doable with normal array/string methods but took as long as a solid 5kyu with all the conditionals. If I could vote 'Worst Practices' for my own solution, I surely would.
This comment is hidden because it contains spoiler information about the solution
Your encrypt function is what I couldn't quite figure out how to do. I tried making 's' an array, pushing to a new array, joining and concatenating the odd and even chunks, and making it equal to 's' again but never got it to work. Glad I found your solution of keeping it as a string even though I don't understand the decrypt function.
Most real roadmaps I've used have been fairly detailed which would spoil things for anyone who hasn't solved this yet. An overall minor hopefully non spoiler hint might be that the number of words in the input string is equal to the highest number in the words. I'd suggest going on discord to ask and/or browsing the MDN for string or array methods that might help.
@Jugo61 where you have "... that's 1 + (1+2+3) + (1+1+2+3+2+8) = 24" in the second set of parentheses, you have two "1"'s next to each other when summing the last persons wait time for machine one. The last person waits 1 minute then waits 2 minutes during machine cleaning and so forth equaling 23. Not sure what the sentence starting with "For..." is trying to say.
Loading more items...