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'm surprised that this is quite highly voted as clever, as I wrote pretty much the exact same code and it was my first ever C# code.
I wonder why only version 2.4 of TypeScript is enabled?
I was suprised to discover that I can't use
Object.entries()
and had to write my own object-iteration code.I think the typescript template should at least define the parameter type. Currently it's:
My suggestion:
I suggest an additional test for a scenario where the template contains no
#
characters:IMHO this line in description:
conflicts with the lines that follow:
It states that I don't have to validate numbers, and then goes on talking how to deal with numbers that don't fit the pattern, which essentially is a validation logic.
It's also confusing to me what does "digits in a number that can't be formated" mean and how one is supposed to skip them.
I suggest rewriting the description as follows:
Also, the title "Introduction" doesn't make sense when it's followed by the whole description of the problem.
Problems with typography and Markdown formatting:
# heading
not###heading###
The description should say what to do about corner cases:
"_A__B"
I think the description should simply say:
This comment is hidden because it contains spoiler information about the solution
Well, I haven't really come across many katas in puzzle category. So I made a search and looked into several examples, but I have to admit I saw no clear pattern. There were some code-golf problems, but also a whole lot of other things ranging from counting even numbers to implementing MineSweeper. Importantly I noticed no other problems where only one solution would be applicable.
I also have no idea how to research for a solution to this problem. I guess one could google for "shortest code for reversing array in JavaScript", but that's just googling for the exact answer.
But most importantly, as many others have commented, a correct solution to this kata is actually not even possible - according to description the solution should reverse an array containing any types, but the .sort() solution will fail when the array contains undefined values.
What I mean is that there's no way to solve this in a better or worse way. You either solve it in the one-and-only way or you won't be able to solve it at all. There's no middle-ground. There's nothing to learn from looking at other solutions and seeing how they compare to yours, as all the solutions are the same. You won't come back to this problem on another day to see if you could do better. I think this problem completely misses the spirit of katas.
This is the worst kata I've experienced. You either know the expected solution or you don't. Nothing to learn from this.
I have trouble understanding the description:
My guess is that the author meant the following:
This comment is hidden because it contains spoiler information about the solution