• Note : You are not allowed to use the word "itertools" in your solution

    Why? This is pointless and the mere existence of this information is a massive hint to the kata itself.

    If you want to enforce it, the kata should've been written in a language where this is not possible (which means most languages, but definitely not Python).

  • instead of accumulating the letters into a you are taking the first character of a at every call, so it never grows beyond 2

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

  • Approved

  • JavaScript translation kumited. I learned a thing or two from your test cases, thanks :)

  • Nice kata. I love that you actually make real acrostics for the random tests while you can just throw in random letters. That's some dedication!

  • The point of contention is how to deal with females in the lineage. In particular, the question is whether the presence of a female...

    1. instantly disqualifies all further siblings of being considered a seventh son (this is the only bit the description describes)
    • 2a. instantly disqualifies all further siblings (male or female) of being the ancestors of any seventh sons (i.e. this particular branch in the tree is completely disregarded)
    • 2b. can the female herself be the ancestor of a line of seventh sons

    The random tests do not appropriately cover this (as can be seen in my solution, which terminates the search in a given branch if a female is found within the first 7 children of any given ancestor)

  • python version has code in preloaded for no reason

  • (python)

    These two solutions, both of which pass:

    https://www.codewars.com/kata/reviews/5a15fed357f0af5e19001946/groups/6146095c0d73b6000140e7d0
    https://www.codewars.com/kata/reviews/5a15fed357f0af5e19001946/groups/6145f501427c9d0001d75559

    produce different answers for this pretty basic input:

    eighth_daughter_has_a_ssoss = {
        "name": "A",
        "gender": "male",
        "children": [
            {"name": "a", "gender": "female", "children": []},
            {"name": "b", "gender": "female", "children": []},
            {"name": "c", "gender": "female", "children": []},
            {"name": "d", "gender": "female", "children": []},
            {"name": "e", "gender": "female", "children": []},
            {"name": "f", "gender": "female", "children": []},
            {"name": "g", "gender": "female", "children": []},
            {
                "name": "h",
                "gender": "female",
                "children": [
                    {"name": "B", "gender": "male", "children": []},
                    {"name": "C", "gender": "male", "children": []},
                    {"name": "D", "gender": "male", "children": []},
                    {"name": "E", "gender": "male", "children": []},
                    {"name": "F", "gender": "male", "children": []},
                    {"name": "G", "gender": "male", "children": []},
                    {
                        "name": "H",
                        "gender": "male",
                        "children": [
                            {"name": "I", "gender": "male", "children": []},
                            {"name": "J", "gender": "male", "children": []},
                            {"name": "K", "gender": "male", "children": []},
                            {"name": "L", "gender": "male", "children": []},
                            {"name": "M", "gender": "male", "children": []},
                            {"name": "N", "gender": "male", "children": []},
                            {"name": "O", "gender": "male", "children": []},
                        ],
                    },
                ],
            },
        ],
    }
    
    find_seventh_sons_of_seventh_sons(json.dumps(eighth_daughter_has_a_ssoss))
    
  • (swift)
    Sample fixture doesn't allow for anonymous parameters, but the tests are written without parameter names.

  • This solution took me way longer than I thought it would.

  • No idea ~~

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

  • Loading more items...