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.
Whatever I was saying was not specific only to this kata and its not about solving this kata,May be I am wrong in this case But it was about expressing idea and expressing it more beautifully.
See I have practiced on lot of sites like:-
Codechef
Hacker Earth
Hacker Rank
codeforces
etc
But, truly these are nothing in front of Codewars.What is best about Codewars is it manages people from all background and it gives a good start to beginners or layman.It builds interest which in itself is very difficult.It motivates me and other 1000s like me to code.But if we can follow something good from others it will eventually makes us more better.Thanks for feedback
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 ;-)
you should explain examples with cases such as:-
1>XIRSOTEOWTORXNZITUREIEFNWHOES
2>RTNNEEEFOISORENIRHVTUEGEZHE
It is because
When you see test cases and come up with solution there are variety of different ways to look and think at test cases and code but above cases what is happening as one is getting different combinations of result some are exhausting total characters and some or not.
Hope I am not clear at all.
Well leave .Let me be more simpler and straight forward
I am able to solve all the test cases ,but still many random test cases I am failing in. Please make sure that if any one is able to run all the cases given in example as description.Then he should be successfully able to pass the kata. As simple as that My humble request.
As in different coding competition I have participated I have experienced If you are able to run the
cases present in examples(1-7 cases)you are done
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.
its not about solving kata and making the solution work . It is about good methodology .As we all know computer science in it-self is very evolving and dynamic in nature.What I am doing is giving you the other way to express kata in more better way.
Example:-
Suppose I designed a kata:-
Add Numbers
You have to return sum of two numbers.
For Example:-
1+2 = 3 should return 3
3-(-5)=8 should return 8
Now, looking a examples in description I start to code.......
then,
comes Random test cases into picture saying that
Failing for:-
z1= 4+8i;z2 = 7 // should return 11+8i
Then , one knows Oh complex numbers are also there for addition ,Afterwards go and change the code accordingly. Unnecessarily timewaste
So. You should have mention it above only
It is what I have seen in most katas.
what can be done:-
Add Numbers
You have to return sum of two numbers.
For Example:-
1+2 = 3 should return 3
3-(-5)=8 should return 8
z1 = 5+8i; z2 = 6+9i; should return 11+17i
see in his kata I am able to run examples under description Then why my RANDOM TEST CASES is failing
It is failing because it is bit complex So please explain that complex cases in example as it becomes easy and less time waste.It is not about running solutions .But about an better idea to express
PLEASE TAKE IT ONLY IF YOU NEED OTHERWISE LET IT GO.
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. ;)
In description under example:-
s="ONE"
s="EON"
What I am trying to say is I am successfully able to run all test cases for the examples.But, Random test case it is failing everytime As I am trying to work in according to some random test case example.It is failing again.So, I am saying you are just putting some simple examples in description according to which one codes. But it fails in Random test cases and one has no idea of what to code
As i have seen in many other coding competitions when they are giving descriptions like
In example there are 3 catagories under description-
1>Simple test case-----like you did
2>Medium test case-----Missing
3>If exist(difficult test case)------Missing
so by looking all test cases from simple---->difficult.It becomes fairly easy for one to code
But, this not I am saying to you but it is general .In codewars I have seen people explain some examples of test cases in description
and when code accordingly and run then Some RANDOM TEST CASES fails Then you have to look at random test cases and again modify your code
like - in this kata.Many times it becomes a case of heat and trail that you do by seeing at random test cases.which ultimately increases complexity of kata.And it becomes hard to understand what you want one to code exactly
Loading more items...