DPrinceKumar / HacktoberFest2020-1

Open for all and will be accepted within 24 hrs. For contributing. Write program in any language,Make sure you write your name as well
89 stars 448 forks source link

Create Redundant_Braces.c #635

Open Mustafa2911 opened 4 years ago

Mustafa2911 commented 4 years ago

Redundant Braces You are given a mathematical formula consisting of '*', '-', '+', '/'. The formula also contains brackets '()'. These formulas are given as assignments to the students for evaluation but the Teacher has made a small mistake while preparing the assignment. He has added redundant braces. If the formula is ((a+b))+c, you can see there is an extra bracket around a+b, which means this formula has 1 redundant bracket. Your task is to find whether the given formula consists of a redundant bracket or not.

Example Input ((a+b)) Output 1