Ad
  • Default User Avatar

    credit to @marksiemers for i/9/3*3 + i%9/3 == x

  • Default User Avatar

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

  • Default User Avatar

    @herathe - I dislike the monkeypatching of Array =\

  • Default User Avatar

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

  • Default User Avatar

    Likely code runner server performance issues, check: https://codewars.statuspage.io/

  • Default User Avatar

    Likely code runner server performance issues, check: https://codewars.statuspage.io/

  • Default User Avatar

    Description isn't clear. The given link had a better explanation of expected output. More examples would be useful.

  • Default User Avatar

    Maybe the problem was changed, but this wasn't a problem for me.

  • Default User Avatar

    I guess the docs don't explicitly mention that all? short-circuits too. The same is true of none? and any?, by the way.

    Temporary objects will be created in memory anyways. I prefer to avoid line wrapping and indent-nesting when possible.

    Also updated valid9 criteron because there was no guarantee of only positive numbers.

  • Default User Avatar

    You're right. His solution doesn't correctly validate all sudokus - it just passes all the test cases. Find any valid sudoku and swap the 6th and 7th rows to create an example invalid solution that this solution incorrectly passes.

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    It is unclear when and where code is called/run due to the (presumably intentional) obfuscation.

    Finding the solution to this kata felt unrewarding to me.

    The provided hints were mostly unuseful, and this kata ended up just being a ton of trial and error attempts to get a direct reference to the ADMIN object.

  • Default User Avatar

    I've a couple test cases that demonstrates how this problem is insufficiently defined and needs more test cases:

    voters1 = [ [:a, :b, :c], [:a, :b, :c], [:a, :b, :c], [:b, :c, :a], [:b, :c, :a], [:c, :b, :a], [:d, :b, :a], ]
    voters2 = [ [:a, :b, :c], [:a, :b, :c], [:a, :b, :c], [:b, :c, :a], [:b, :c, :a], [:c, :b, :a], [:d, :b, :a], [:e, :b, :a], ]
    

    For example, @hencethus and @evilscott/@Dima83 have differing solutions that pass the tests. However:

    @hencethus's solution maintains tallies across iterations, disqualifying losers along the way.

    • voters1 - no winners because :a and :b tie during the second iteration
    • voters2 - declares :b as winner during the second iteration

    @evilscott's and @Dima83's solution declares the candidate with the most first-votes to be the winner rather than the one with "more than half the total votes"

    • voters1 - finds the winner to be :a during the first iteration
    • voters2 - finds the winner to be :a during the first iteration
  • Loading more items...