using System.Collections.Generic;
public static Dictionary<string, bool> input = new Dictionary<string, bool>()
{{"()", true}, {"(()))", false}, {"(()(()))", true}};
const string paranthesesOpen = "(";
const string paranthesesClose = ")";
const string bracesOpen = "{";
const string bracesClose = "}";
public static void Main()
foreach (KeyValuePair<string, bool> item in input)
bool act = IsBalanced(s);
Console.WriteLine(exp == act ? "PASS: cases: \"{0}\"; expected: {1}; actual: {2}" : "FAIL: cases: \"{0}\"; expected: {1}; actual: {2}", s, exp, act);
public static bool IsBalanced(string s)