Ad
  • Custom User Avatar

    I wasn't really expecting that one to be added, but maybe a somewhat more strenuous test is needed to weed out attempts (like my first) that are actually plain wrong.

    EDIT: Also, I just looked, the 2kyu version doesn't include Javascript, which is a shame. Not there yet with Python.

  • Custom User Avatar

    I re-submitted a solution, since although my original passed the tests, it would have definitely failed on some puzzles. E.g. the (supposed) hardest ever puzzle (below).

    var puzzle = [
        [8,0,0,0,0,0,0,0,0],
        [0,0,3,6,0,0,0,0,0],
        [0,7,0,0,9,0,2,0,0],
        [0,5,0,0,0,7,0,0,0],
        [0,0,0,0,4,5,7,0,0],
        [0,0,0,1,0,0,0,3,0],
        [0,0,1,0,0,0,0,6,8],
        [0,0,8,5,0,0,0,1,0],
        [0,9,0,0,0,0,4,0,0],
    ];
    var solution = [
        [8,1,2,7,5,3,6,4,9],
        [9,4,3,6,8,2,1,7,5],
        [6,7,5,4,9,1,2,8,3],
        [1,5,4,2,3,7,8,9,6],
        [3,6,9,8,4,5,7,2,1],
        [2,8,7,1,6,9,5,3,4],
        [5,2,1,9,7,4,3,6,8],
        [4,3,8,5,2,6,9,1,7],
        [7,9,6,3,1,8,4,5,2],
    ];
    

    It's probably too late but maybe harder tests might filter out false solutions like my original submission.

  • Custom User Avatar

    And ... it works.

    Not sure what to take from this, except 'turn it off and on again' :)

    Thanks a lot for sticking with this.

    Ps. I will look at some of the amazingly concise solutions for some of the tools you mentioned.

  • Custom User Avatar

    I updated it with a much smaller example (and put the back-ticks in).

  • Custom User Avatar

    I was trying to fulfill the bonus bits ...

    -Avoid creating an array whose memory footprint is roughly as big as the input text.
    -Avoid sorting the entire array of unique words.

    Hers's an example of input that fails:

    'BxhhnNv':,?'BxhhnNv'._.?.'BxhhnNv'.'BxhhnNv'??'BxhhnNv',,,!;'BxhhnNv'-'BxhhnNv'-;'BxhhnNv'_-'BxhhnNv'..!,!'BxhhnNv'._: -'BxhhnNv'-;'BxhhnNv';'BxhhnNv'_'BxhhnNv':..,.'BxhhnNv'_,??

    The fail message is:

    Incorrect match: words not present in the string. Your output: ['bxhhnnv']. One possible valid answer: ["'bxhhnnv'"]

    As I say though, locally I get the valid answer.

  • Custom User Avatar

    Thanks for that, I ended up using a html pre tag - it's readable now.

  • Custom User Avatar

    Is there a help section for formatting these text boxes?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I didn't know about the spoiler tag -> no notification. I'll post my code in a seperate reply and spoiler tag that.

    Anyway, I'm not using global variables and I'm not sure what you mean by hidden variables. Also, I did try to look through the changelog - there was nothing that stood out to me.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    I'm getting some fails that only occur on the server when one or more of the returned words contain an apostrophe.

    For example, Incorrect match: words not present in the string. Your output: ['xlo', "u'y", 'wfwzsg']. One possible valid answer: ['xlo', "u'ywfwzsg", 'ndqih']

    But, when I run this example locally (PyCharm, Windows), I get output ['xlo', "u'ywfwzsg", 'ndqih'].

    Can anyone help me understand why this is happening?

  • Custom User Avatar

    Got it. Thanks.

  • Custom User Avatar

    Example test case: no_musical(2040, 2174, 3, 17) which is supposed to result in 0 classes missing musicals.

    But, seeing that the last musical occurs in year 2172, surely the classes of 2173, 2174 both miss out, hence the result should be - at least - 2.

    Btw, I've labelled this as a question as I may have misunderstood something.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Thanks for this. Forced me to learn about a new toy.

  • Loading more items...