Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

maximum valid parentheses

public static void main(String[] args) {
    String s="))((())";
    String finalString="";
    for(int i=0;i<s.length();i++){

         if (s.charAt(i) == '('&& s.charAt(i+1) == ')') {
         String ss= s.substring(i, i+2);
         finalString=finalString+ss;
        // System.out.println(ss);
         }

    }
    System.out.println(finalString.length());
}
Comment

PREVIOUS NEXT
Code Example
Java :: firebase timestamp to textview 
Java :: gif to blob java 
Java :: How to pass ArrayList of Objects from one to another activity using Intent in android? 
Java :: springBoot ConditionalOnMissingBean 
Java :: decision tree drools using spring boot 
Java :: password = sdf345 password.isalpha() java 
Java :: how to check if rs next is null 
Java :: labelled for loop in java 
Java :: fail method java 
Java :: java singleton with synchronized double check 
Java :: sartt timer of 40 second when send otp andrpid 
Java :: custom validator arrays 
Java :: boxing and unboxing in java pdf 
Java :: jagermeister price in bangalore 
Java :: test function that call a function javascrip 
Java :: java boolean zen 
Java :: jdk full form 
Java :: javafx change application title 
Java :: how to add new nod in dynamic treeview using javascipt 
Java :: java @documented 
Java :: ring check if the operating system is Android or not 
Java :: java private access modifier 
Java :: room ktx dependency 
Java :: 4 byte timestamp java 
Java :: java list sort comparator date descending lambda 
Java :: your application is missing a valid safety identifier 
Java :: java memory cleaner 
Java :: jav convert array as list to array 
Java :: RNGestureHandlerButtonViewManager.java uses or overrides a deprecated API 
Java :: how to add element in java arraylit syntax in gfg 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =