Sha256: fe29cb7db6ed7af03aff733c7b594e883ca41c89ef355d03465fb1836c3b80d0
Contents?: true
Size: 622 Bytes
Versions: 134
Compression:
Stored size: 622 Bytes
Contents
module BracketPush open System let isPaired (input: string) = let brackets = "[]{}()" |> Set.ofSeq let filtered = input.ToCharArray() |> Array.filter brackets.Contains |> String let replaceMatchingBrackets (str: string) = str.Replace("[]", "").Replace("{}", "").Replace("()", "") let rec loop (remaining: string) = match remaining.Length with | 0 -> true | _ -> let updated = replaceMatchingBrackets remaining match updated.Length = remaining.Length with | true -> false | false -> loop updated loop filtered
Version data entries
134 entries across 134 versions & 1 rubygems