diff --git a/BalancedParantheses.java b/BalancedParantheses.java new file mode 100644 index 0000000..f48ce38 --- /dev/null +++ b/BalancedParantheses.java @@ -0,0 +1,37 @@ +/** + * Created by Vatsal Gosaliya on 15-Jul-16. + * + * PROBLEM: Check if the given string contains a balanced pattern of parantheses. + */ + +import java.util.Stack; +class BalancedParantheses { + + public boolean solution(String a){ + int size = a.length(); + int check = 0; + Stack s = new Stack(); + + for(int i=0;i