7 kyu

Arrays of the Right Depth

Description
Loading description...
Lists
Arrays
  • Please sign in or sign up to leave a comment.
  • Blind4Basics Avatar

    Hi,

    The description is misleading. Or the tests are not built correctly, I'm not sure...
    What I did is count the depths of the empty arrays only. That's not matching "the depth of all subarrays" => either the tests are insufficient, or the description is misworded.

    Cheers

    • DrillToHeaven Avatar

      Ahh, I think, I got what you meant. This is indeed misleading. I have just changed my description. Could you confirm if it sounds alright now?

    • Blind4Basics Avatar

      I actually don't see any difference... :thinking:

      First things first: is that correct? [[[]]], {2:1} -> True

    • DrillToHeaven Avatar

      I tried to fix description, I especially tried to remove term subarray from it. but probably I misunderstood... Yeah, [[[]]], {2:1} -> True is correct. The idea is that first layer of brackets is the main array which does not affect other 2 layers of brackets [[]]

    • Blind4Basics Avatar

      ok, so:

      • that example should be the first one in the description and the tests

      • the actual specs are something like (rewroding might be needed here or there):

        • the constraint dict gives {depth: maximum number of empty arrays at this depth}
        • the user has to check if all the empty arrays in the input are matching the given constraints
        • Depth is zero-based, here (meaning, the inner empty array in [[]] has a depth of 1)

      BTW: why this constraint There will always be at least one array in the input.? As long as the input is an array, it could also be empty. It's just that it will satisfy any constraint.

    • DrillToHeaven Avatar

      Thank you very much for your help! I have just changed completely the description and it should ( I hope ) sound better. The constraint "There will always be at least one array in the input." was me trying to be nice to the solvers but I agree that it could be also be empty. I will try to avoid this practice in the future!

    • Blind4Basics Avatar

      yup, LGTM :+1:

      Issue marked resolved by Blind4Basics 4 months ago
  • HerrWert Avatar

    I like the kata! It provided me with some valuable practice. My only suggestion would be to change the line "Dictionary may be empty at all" to "Dictionary may be completely empty." (The expression "at all" is only used in negative statements, e.g., "The dictionary contains nothing at all.")