using System.Collections.Generic;
public static void Main()
Console.WriteLine(IsValidParentheses("()"));
Console.WriteLine(IsValidParentheses("((()))"));
Console.WriteLine(IsValidParentheses("()()()"));
Console.WriteLine(IsValidParentheses("()("));
Console.WriteLine(IsValidParentheses("((())"));
Console.WriteLine(IsValidParentheses(")(())("));
public static bool IsValidParentheses(string s)
Stack<char> stack = new Stack<char>();
for(int i = 0; i < s.Length; i++)
if (symb == '(') stack.Push(symb);
if (stack.Count == 0) return false;