Ad
  • Custom User Avatar
  • Custom User Avatar

    Rejected: no random tests

  • Custom User Avatar

    I hope I'm not missing some obvious errors... Approved!

    In future I would suggest to save the expected result in a variable before calling expect. I don't think it matters here, but if arguments were Lists or whatever, the translation would be vulnerable to input modification, and we don't want that :P

  • Custom User Avatar

    Right you are! Updated: fixed basic tests and updated rundom tests.

    Please review and approve: https://www.codewars.com/kumite/657ee1f1b5a5150024c181e2?sel=658fe5c9dc80170a4c4dcb15

  • Custom User Avatar

    I believe this can generate random tests that have start == end, which contradicts description. Otherwise it's probably OK.

  • Default User Avatar

    i like it u think out of the box.

  • Custom User Avatar

    Thanks for the feedback. However, I think that the core of the problem is getting this surprise exception and finding out how to deal with it. So the description is not talkative on purpose.

  • Custom User Avatar

    I really like this Kata, but in my opinion the fact that the BadCodeException will get thrown out if the inputCode for unlocking the chest is wrong should be writen in the description, as this wasn't immediately clear to me.

  • Custom User Avatar

    either do a deep copy
    or don't do any copy at all, but compute the expected result before you call to the user's function.

    Done both :smile:

  • Custom User Avatar

    Fixed now, thanks.

    Not yet: you only did a shallow copy. Meaning the sets are still mutable on the user side with side effect. So:

    • either do a deep copy
    • or don't do any copy at all, but compute the expected result and the error message before you call to the user's function.

    cheers

    edit: actually, just remove the message: this is exactly what the default message is supposed to be, so you're actually printing it 2 times (the provided message is always added to the default one)

  • Custom User Avatar

    Right. The input data could be forged. I didn't think about that. That wasn't in the spirit of the problem solving, but still possible.
    Fixed now, thanks.

  • Custom User Avatar

    I like it. Updated. Slightly changed: i've put the last purpose in the input section.
    Marking this as solved.

  • Custom User Avatar

    all good, except I'd change the first 2 lines:

    You have a directed graph, with nodes numbered progressively from 1 to N. Graphs can be represented in many ways.
    In this problem, you are given a graph in the form of a dictionary of sets of successors. Return the corresponding adjacency matrix.

    to:

    Graphs can be represented in many ways.
    In this problem, you are given a directed graph in the form of a dictionary of sets of successors and you need to return the corresponding adjacency matrix. Nodes are numbered from 1 to N.

  • Custom User Avatar

    Alright, now i've caught up with terminology. Edited the description, how is it now?

  • Custom User Avatar

    thanks, fixed

  • Loading more items...