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.
Well, I scuffed my way through... I feel like I cheated haha. I feel like I only passed because the long tests were set and not randomised.
Thank you! So frustrating when a kata's most difficult challenge is its poor description.
This comment is hidden because it contains spoiler information about the solution
Haha, I'm tempted to not even mark this clever, but it's definitely something I'll give you that.
I get you, the description is a little difficult to understand, and staring at the examples don't really help.
Essentially what the description is telling you to do (to encrypt) is to split the string(s) into two groups, one group is the parts of the string at an odd index location, and the other group being the parts of the string at an even index location. Then simply combine these two groups and you have the encryption method.
And you have to repeat this n number of times.
I hope that clears it up for you - and I don't believe anything I wrote here is a spoiler, it's merely a rewriting of the description (people can be a little heavy handed with flagging spoiler content, and that may stop you and others from seeing it if needed).
I wouldn't consider this an 8 kyu, maybe a 7 or 6, but defo not an 8. Otherwise I quite enjoyed this one, despite going about it in a somewhat unorthodox way.
I can see why various people are upset by this kata. Firstly the description is woeful at explaining what it is it wanted. I had assumed it wanted me to combine the lengths of the strings of both arrays and then giving the maximum difference between these two numbers. More confusion is further caused because the only example test returns 13, but looking at the most obvious solution to get 13 would be the length of the two arrays combined. I only worked out what was needed of me by going through these comments.
What the kata is actually asking of you is to find the largest and smallest string length in both arrays, and then return the (largest string length - smallest string length) that gives the biggest difference.
A couple more examples need to be shown to clear up the misunderstandings, and the Kata Description more clearly written.
Such a clean and elegant solution. What surprises me most is that multiple people have given such a genius answer.
Had me for a bit; first time I've encountered called functions within called functions and I wasn't really sure how to approach it. Seems there's many ways to handle this one, not totally satisfied with how I did it, but it seems it's not the worst way either.
Man I'm an idiot. Over complicated it because I misunderstood the rules and was confused why my code was so long for a 7kyu. It was such an easy solve once I looked at the rules again.
Ahhhh I could kick myself, first time seeing the more obvious rounding method, and it makes for such simple and elegent solutions. Always disheartening seeing your answer looking more like 'Lord of the Rings' in line count compared to the answers others gave.
Anyway, I think the number pattern, and the fact that we had to create it, could have been explained better; I originally didn't understand the kata and fumlbed a bit before coming back to it.
As far as I'm concerned, one of the core skills in programming is being able to find a solution to your problem on sites such as stackoverflow. Nobody should expect you to memorise all syntax, methods, operators etc- but you should understand what it is that is going on in the examples and solutions on these sites to learn from them.
At least that's just my view of it anyway.
Not a particular fan of this one. Perhaps I'm just a code newb, but it seems to me that I should have been concentrating more on simply replacing the first letter of every word with a capital, rather than trying to work out how to deal with the String.prototype.toJadenCase set up.
In the end my code ended up a novel compared to everyone else... ah well.
This comment is hidden because it contains spoiler information about the solution