Question: NEED PSEUDOCODE FOR THIS CODING package array; public class Array { /** * @param args the command line arguments */ public static void main(String[] args){

NEED PSEUDOCODE FOR THIS CODING

package array;

public class Array {

/**

* @param args the command line arguments

*/

public static void main(String[] args){

Scanner ar = new Scanner(System.in);

String bracket = ar.next();

char br[] = bracket.toCharArray();

int flag, output=0, k=br.length;

for(int i=0; i

flag=0;

if(br[i]==')')

continue;

for(int j=i; j

if(br[(j%k)] == '(' )

flag++;

else

flag--;

if(flag<0)

break;

}

if(flag==0)

output++;

}

System.out.println( + output);

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!