title: Find Expression Duplicate Parenthesis Not
signature: class Solution {
  
      public Boolean findExpressionDuplicateParenthesisNot(String string_arg0) {
source_py: def find_expression_duplicate_parenthesis_not(string):
      Stack = []
      for ch in string:
          if (ch == ')'):
              top = Stack.pop()
              elementsInside = 0
              while (top != '('):
                  elementsInside += 1
                  top = Stack.pop()
              if (elementsInside < 1):
                  return True
          else:
              Stack.append(ch)
      return False
source_cpp: bool find_expression_duplicate_parenthesis_not(string str) {
    stack < char > Stack;
    for ( char ch : str ) {
      if ( ch == ')' ) {
        char top = Stack . top ( );
        Stack . pop ( );
        int elementsInside = 0;
        while ( top != '(' ) {
          elementsInside ++;
          top = Stack . top ( );
          Stack . pop ( );
        }
        if ( elementsInside < 1 ) {
          return 1;
        }
      }
      else Stack . push ( ch );
    }
    return false;
  }
question_info.extension: java
question_info.entry_fn_name: findExpressionDuplicateParenthesisNot
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": true, "inputs": {"string_arg0": "((a+b)+((c+d)))"}}, {"idx": 1, "outputs": true, "inputs": {"string_arg0": "(((a+(b)))+(c+d))"}}, {"idx": 2, "outputs": true, "inputs": {"string_arg0": "(((a+(b))+c+d))"}}, {"idx": 3, "outputs": false, "inputs": {"string_arg0": "((a+b)+(c+d))"}}, {"idx": 4, "outputs": false, "inputs": {"string_arg0": "(8582007)"}}, {"idx": 5, "outputs": false, "inputs": {"string_arg0": "((a+(b))+(c+d))"}}, {"idx": 6, "outputs": false, "inputs": {"string_arg0": "(PylsShEdKAE)"}}, {"idx": 7, "outputs": false, "inputs": {"string_arg0": "886980680541"}}, {"idx": 8, "outputs": false, "inputs": {"string_arg0": "001"}}, {"idx": 9, "outputs": false, "inputs": {"string_arg0": "jsVmFeOq"}}]
question_info.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String string_arg0, Boolean expected){
          try{
              Driver driver = new Driver();
              if (driver.run(string_arg0,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("((a+b)+((c+d)))", true);
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("(((a+(b)))+(c+d))", true);
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("(((a+(b))+c+d))", true);
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("((a+b)+(c+d))", false);
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("(8582007)", false);
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("((a+(b))+(c+d))", false);
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("(PylsShEdKAE)", false);
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("886980680541", false);
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("001", false);
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("jsVmFeOq", false);
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String string_arg0, Boolean expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(string_arg0),expected);
      }
      
      public boolean validateSolution(Boolean actual, Boolean expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__