Do you rise to the challenge !? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Do you rise to the challenge !?

You are given a sequence of characters consisting of parentheses () and brackets []. A string of this type is said to be correct : if it is an empty or null string, the string A is correct, (A) & [A] are correct and if the string A and B are correct, the concatenation AB is also correct Exp : [()] & (()[]) are correct, ([)] & (( aren't correct Implement the method check(String str) to check the correctness of a string of this type. check returns true if the string is correct, false otherwise. https://code.

12th Sep 2017, 2:44 PM
Seb
3 Answers
12th Sep 2017, 4:27 PM
Joe McMillan
Joe McMillan - avatar
0
classe A { static boolean check(String str){ } }
12th Sep 2017, 2:45 PM
Seb