section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 4GZ
icon
Related questions
Question

Detail code only else downvoted.

 

section grouping is a string containing just characters "(" and ")". A standard section succession is a section arrangement that can be changed into a right math articulation by embedding characters "1" and "+" between the first characters of the grouping. For instance, section successions "()()" and "(())" are standard (the subsequent articulations are: "(1)+(1)" and "((1+1)+1)"), and ")(", "(" and ")" are not. 

You are given an integer n. You will likely develop and print precisely n diverse customary section arrangements of length 2n. 

Input :The primary line contains one integer t (1≤t≤50) — the number of experiments. Each experiment comprises of one line containing one integer n (1≤n≤50). 

Output :For each experiment, print n lines, each containing an ordinary section grouping of length precisely 2n. All section groupings you output for a testcase ought to appear as something else (however they might rehash in various experiments). In case there are different replies, print any of them. It tends to be shown that it's consistently conceivable

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning