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.
Thank you, putting it through the tests pointed out a flaw in my code that I had to add a conditional for.
*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.
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.
This comment is hidden because it contains spoiler information about the solution
Look at solutions of commenter above me @nicholas1301 and my solution both not using regex in JS. I also put comments in my code to explain what I did. If you haven't unlocked solutions and want hints just ask. As someone who avoids using regex to solve problems even if takes 5 times longer, I enjoyed using a combination of string and array methods to solve this one.
Can anyone recommend resources to understand how the Dirichlet principle would help solve problems like this? I read about it and watched a few videos and can't see how this principle would apply here. I see patterns when i return an array of the individual integers of the sums but can't figure out how to use what I know to make an equation to reliably solve every test case.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
The only "bug" in testing is that the testing (in JavaScript at least) doesn't test for greater than triplets(more than 3 instances in an array) of all numbers. So it's more of a bug that allows bad code to pass(like mine) rather than a bug that blocks good code from passing.
Loading more items...