Ad
  • Custom User Avatar

    I'm having the same issue where I feel the instructions aren't well clarified (I wrote a separate comment about it above). Could you help define it? I'm confused as to why "([{}])" would return true but "[(])" would return false

  • Custom User Avatar

    You could also inductively define valid strings like so:

    1. The empty string is valid. (e.g. "")
    2. If x and y are both valid strings, then xy is a valid string. (e.g. x: "()" y: "[]" xy: "()[]")
    3. If x is a valid string, then (x), [x] and {x} are all valid strings. (e.g. x: "()[]" also valid: "(()[])", "[()[]]", "{()[]}")

    This matches the current requirements while also being precise.

  • Default User Avatar

    A string of braces is considered valid if all braces are matched with the correct brace.

    Way too loosly defined in my eyes.
    There could be clear rules for the validity of scoping braces:

    1. an valid expression starts with the outer scope represented by '(' & ')' and nested scopes are surrounded by '[' & ']' and further nesting by '{' & '}'
    2. an expression is invalid if there is no closing partner

    This would produce clearer rules and less ambiguity for the kata.
    But the current examples are different: "(){}[]" => true
    Still the solutions are somewhat taking order of scopes into account, which isnt mentioned in the instructions

  • Default User Avatar

    so many options for nice pattern matching in haskell but some ppl just want to stick with regrets

  • Default User Avatar

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