Sha256: b1fe735da22a2df6c9f601ea705c00a354ec27fd695cf2a12a648c6e596d2ea3
Contents?: true
Size: 523 Bytes
Versions: 208
Compression:
Stored size: 523 Bytes
Contents
using System.Linq; public static class BracketPush { public static bool Matched(string input) { var brackets = new string(input.Where(c => "[]{}()".Contains(c)).ToArray()); var previousLength = brackets.Length; while (brackets.Length > 0) { brackets = brackets.Replace("[]", "").Replace("{}", "").Replace("()", ""); if (brackets.Length == previousLength) { return false; } } return true; } }
Version data entries
208 entries across 208 versions & 1 rubygems