Ad
  • Default User Avatar

    I quickly added up @ivoryblakk's first example score and got a 100.

    tim: 'IS',                8
    jim: 'cleaning',          4
    randy: 'trading',         6
    sandy: 'accounts',        1
    andy: 'trading',          6
    katie: 'pissing about',   25
    laura: 'change',          6
    saajid: 'trading',        6
    alex: 'canteen',          10
    john: 'pissing about',    25
    mr: 'regulation'          3
    

    8 + 4 + 6 + 1 + 6 + 25 + 6 + 6 + 10 + 25 + 3 = 100

    So I think your maths went wrong at some point ;)

    I just tested my JS solution and it's working fine.

    And @ChrisWatkins, what language are you using? The last test doesn't make sense, since 3x 'pissing about' is already close to over 80. Could it be that you're mutating the input object?

  • Custom User Avatar

    Have had the same issue as above, with many tests.

    So far consistently getting 20-30 failed tests per run.

    Manually spot checking tests has shown my solution to get the correct response, yet the test still fails.

    { tim: 'finance',
    jim: 'regulation',
    randy: 'regulation',
    sandy: 'pissing about',
    andy: 'trading',
    katie: 'finance',
    laura: 'regulation',
    saajid: 'retail',
    alex: 'IS',
    john: 'pissing about',
    mr: 'trading' }

    It should work for random inputs too - Expected: 'kill me now', instead got: 'i can handle this'

    TOTAL: 88 - return 'i can handle this'

    { tim: 'accounts',
    jim: 'IS',
    randy: 'cleaning',
    sandy: 'IS',
    andy: 'IS',
    katie: 'pissing about',
    laura: 'regulation',
    saajid: 'retail',
    alex: 'change',
    john: 'pissing about',
    mr: 'pissing about' }

    It should work for random inputs too - Expected: 'kill me now', instead got: 'party time!!'

    TOTAL: 118 - return 'party time!!'

    Ran a test using the below code;

    function boredom(staff){ return 'kill me now' }

    All randomised tests passed - 2 failures from sample tests which appear to run correctly.

  • Default User Avatar

    Lazy is looking at all kinds of tests instead of thinking about all the cases when the problem is already completely defined. (It's not that the tests must not be added, but they don't have to.)