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.
Thanks for the reply.
I think the first two still don't seem to address the issues of repeated numbers or skipped numbers.
This seems a simpler solution to make clear all three
Test.assertEquals(originalNumber("XNFSIONSUXERISXRIOUFWTOIISNXEIN"),"244666699")
Thanks for your feedback. ;-)
Added these three basic testcases:
For a clearer explanation, it might be worth including in your examples things more complex than "TTONWOHREEE"
e.g. give an example that does not begin with 1, give an example that skips numbers in the sequence (349 etc), or perhaps give some numbers that have a repeating adjascent numbers (e.g. 244666699) etc.
I understand that you don't rule out the possibility of any of these happening, but for clarity's sake, particularly for those whose first language isn't English, it might be worth either showing (in your example numbers) or saying explicitly that the above examples are possible.
Alternatively:
Look at the JS version, there are already 68 people who solved the kata, so clearly this kata is possible ;-)
If you find yourself unable to pass the kata, perhaps you need to
git gud
and try harder?I think that you are not completely understand how to solve this kata. Trust me, there is no combination, also no different result. Each testcase can only got one valid result.
And, to find a correct way is your job, not mine ;-)
Should I add: the input string may be very long, perhaps someone feel complex, but In fact, it doesn't increase the complex of your code.
Should I add: the number may contains all digits. all digits means 0123456789, instead of 123.
Well. Please tell me, what thing I didn't written in the description? I will add it to the description.
Err... Oops I forgot that (should I say that I solved it only yesterday...? ;-o )
@ Amber: so I think you just didn't use an enough general approach, restraining you to the example tests. "Think larger" (especially with myjinxin's katas). ;)
input is a string. I think his trouble is random test too hard to solve, but I don't think so ;-)
What Voile was telling you is that, without more descriptions of what you call "failing random tests", we cannot even know if your complaints are "valid ones" or not. Meaning: what is the fail exactly? Because your trouble looks dangerously as if you were mutating the input array and, in that case, your "complaints" would be fully not valid.
So, are you mutating the input, by any chance?
BTW:
Voile isn't the author of the kata. ;)
???
You didn't point out what needs to be improved so that actions can be taken. How is that going to help anything?
What does "all types of examples" mean? What is "unnecessarily trying to increase the complexity of kata"? Unless you can only count from 1 to 3 or can't spell beyond 3, it's impossible to happen I think?
"Random test cases are failing" is not an excuse for saying kata descriptions are bad. In fact, the random tests are already showing the inputs, which is even better than standard practice:
If your code fails the random tests, unless you have definite evidence the kata is wrong, it's always going to be your fault. (Also, look at the 31 solves!) I don't know where this amount of arrogance from you come from, but it's not helping, and it's so condescending I can't help calling you out. That's not how one goes to get things done and improved :(
While this can be done without using Strings at all, from looking at your code snippet I'd suggest you review your loop conditions.
Think of the solution where you don't have to use strings at all.
You have a number and you can use arithmetic operations to get its digits. That should be faster.
Make sure you exit any loops initialized
Loading more items...