#C13173. Balanced Brackets Checker
Balanced Brackets Checker
Balanced Brackets Checker
Given a string composed solely of the characters '(' and ')', determine whether the string has balanced brackets. A string is considered balanced if every opening bracket '(' has a corresponding closing bracket ')' in the correct order. This means that at no point in the string should a closing bracket appear before its corresponding opening bracket, and in the end, the total number of opening and closing brackets should be equal.
The check can be conceptually described by the following formula in LaTeX:
Your program should read input from standard input (stdin) and write the result to standard output (stdout) as either "True" or "False". ## inputFormat The input consists of a single line containing a string of characters. The string will only include the characters '(' and ')'. ## outputFormat Output a single line: "True" if the string is balanced, or "False" if it is not.## sample
(())
True
$$