Ad
  • Custom User Avatar

    Pretty funny concepts to figure out, nice kata.

  • Custom User Avatar

    I'm OK with both

  • Custom User Avatar

    I think we asked this on Discord ages ago, but for translations do you prefer to keep the cards as strings or is a dedicated card type permissable?

  • Custom User Avatar

    If all of the cards' values belonging to any one suit in one string correspond to all of the cards' values of any one suit in the other string, there is 1:1 mapping. If that is true for all suits appearing in either string, without re-using cards in more than 1 mapping, then return true. This implies that the strings have equal counts (0 <= n <= 4) of cards having the same value, and thus the strings have the same total number of cards and thus the same length. The "hand" isn't scored or ranked.

  • Custom User Avatar

    made a small change to the description and accepted

  • Custom User Avatar
  • Custom User Avatar

    That's a nice Puzzle and really good coding exercise.

    Even though the strategy is simple, it requires A LOT of precision in both thinking and coding.

  • Custom User Avatar

    I think the description would really benefit from clarification that inputs will be easy / random and not adversarial.

    The solutions (at least mine and the top voted one) seem to time out on stupid_input(10), let alone 150.

    def stupid_input(n):
        board = [ ["A"] * n for i in range(n) ]
        word = "A" * (n-1) + "B"
        return board, word
    
  • Custom User Avatar

    That's a very nice test-map.
    I run a 10^6 simulations of a try-random-move-from-options-at-any-point solver and it finds the solution roughly once in 4000 attempts.

    It helped me avoid trying a lot of bad heuristics, and to find a relatively elegant approach to the puzzle.

  • Custom User Avatar

    I don't have an idea for an algorithm that would be significantly faster than a naive solution.

    if you do then go ahead and create a performance version :)

  • Custom User Avatar

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

  • Custom User Avatar

    As I recently mentioned on discord, I changed my mind. Do what you think is the best

  • Custom User Avatar

    I don't understand what i'm supposed to do with the suits. I don't understand how are some not isomorphic and some are. The hand rank does not change

  • Custom User Avatar

    These boards aren't isomorphic:

    • first board has 3h that is the only heart on board
    • the second board has 3c and 8c.

    So the hearts on the first board aren't isomorphic to any suit on the second board

  • Custom User Avatar

    Compare 8c3hJsQd8s, Js8s3cQd8c: True should equal False

    I didn't quite understand this part. If you change 3h to 3c in the first suit, they become the same, hence isomorphic, and there are no other h's in the first suit. Is it the problem with the second suit, where if you swap c with h, 8h and 8c become different? Or anything else?

  • Loading more items...