Ad
  • Custom User Avatar

    All the way across the sky!
    ...whoa

  • Custom User Avatar

    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!

  • Custom User Avatar

    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!

  • Custom User Avatar

    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!

  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Thanks, I may do that!

  • Custom User Avatar

    You're very right! Thank you for pointing that out.

  • Custom User Avatar

    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 (5 true 5 false) 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.

  • Custom User Avatar

    You're right! Thanks for pointing that out.

  • Custom User Avatar

    Thanks for pointing this out! I seem to have approved a previous draft - should have triple checked!

  • Custom User Avatar

    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")

  • Custom User Avatar

    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.

  • Custom User Avatar
  • Custom User Avatar

    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