title: Find Expression Duplicate Parenthesis Not
signature: fun findExpressionDuplicateParenthesisNot(string_arg0: String): Boolean {
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.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.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:Boolean, expected:Boolean):Boolean{
    return actual.equals(expected)
  }
  fun driver(string_arg0: String, expected:Boolean):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(string_arg0), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("((a+b)+((c+d)))", true)
      println("TEST-0...${result}")
      
      result = driver("(((a+(b)))+(c+d))", true)
      println("TEST-1...${result}")
      
      result = driver("(((a+(b))+c+d))", true)
      println("TEST-2...${result}")
      
      result = driver("((a+b)+(c+d))", false)
      println("TEST-3...${result}")
      
      result = driver("(8582007)", false)
      println("TEST-4...${result}")
      
      result = driver("((a+(b))+(c+d))", false)
      println("TEST-5...${result}")
      
      result = driver("(PylsShEdKAE)", false)
      println("TEST-6...${result}")
      
      result = driver("886980680541", false)
      println("TEST-7...${result}")
      
      result = driver("001", false)
      println("TEST-8...${result}")
      
      result = driver("jsVmFeOq", false)
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: findExpressionDuplicateParenthesisNot
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn