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.
All the way across the sky!
...whoa
I've just republished this kata with improvements: https://www.codewars.com/kata/double-rainbow
Thanks for your help with the (very fundamental) issues last time!
I've just republished this kata with improvements: https://www.codewars.com/kata/double-rainbow
Thanks for your help with the (very fundamental) issues last time!
I have just republished this kata (with improvements) here: https://www.codewars.com/kata/double-rainbow
Hopefully should be much less basic problems this time around!
Thanks for the explanation!
I haven't encountered constants yet, but will certainly look into them.
I'm under no illusions that my solution will by any means be the most efficient/concise/elegant - am very much expecting others to submit far shorter, better solutions at this point!
Apreciate the explanations.
Sorry to get back to you on this so late, but would you mind explaining what you mean by this comment below? (I can't seem to be able to reply directly to that comment, so I'm quoting it here):
"Also, this
var letterObj = {1:'A', 2:'B', 3:'D', 4:'E', 5:'G', 6:'I', 7:'L', 8:'N', 9:'O', 10:'R', 11:'T', 12:'U', 13:'V', 14:'W', 15:'Y'};
is what strings (and arrays) are for, and please indent your solution properly. It's unreadable."
I understand what strings and arrays are, of course, but not what you mean by your suggestion. I also understand that the indentation is not ideal, and am fixing that.
Thank you.
Thanks, I may do that!
You're very right! Thank you for pointing that out.
Thanks for the feedback.
You're very right, that second example test is wrong. Thanks for pointing it out.
As for no random tests, I didn't use
Test.randomize
, as I wasn't aware of it. There are, however 10 tests which use randomly generated strings (5true
5false
) each time you attempt them.I'll look into
Test.randomize
, as you advised, and see if there isn't a more simple way to do that.Thank you also for the encouragement. Better is of course what I will be aiming for.
You're right! Thanks for pointing that out.
Thanks for pointing this out! I seem to have approved a previous draft - should have triple checked!
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")
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.
Thank you!
Hello,
The Examples given all start at 1 and increase from left to right. Is this meant to imply that the number to be found will always begin with 1 (unless it features a "leading zero"), or did you just stick to the example of 1, 12 and 123? Could it be 23, 456, 678 etc?
What about skipping numbers in the sequence, could it be 1479 or 479?
Further, does "non strict increasing sequence" here mean a sequence of number that is strictly increasing from left to right? Because that's what all the examples given do, but a search of "non strict increasing" seems to imply that the number would necessarily increase from left to right e.g. 83957