Which cell type nоrmаlly undergоes meiоsis?
Write а methоd cаlledĀ isVаlid that accepts a String as a parameter. The String cоntains an entire Java file where each tоken is separated by a space. In other words, the following Java program: public class Exam{ public static void main(String args){ System.out.println("hello"); }} would be passed in as a String argument like this: String file = "public class Exam { public static void main ( String args [ ] ) { System.out.println ( "hello" ) ; } }"System.out.println(isValid(file)); Your isValid method will return true if the String passed in is a valid Java program with respect to its curly braces. In other words, every left curly brace must have a matching right curly brace. You do not need to worry about anything else. The above String would be valid. The following String is not valid because it is missing a right curly brace: public class Exam { public static void main ( String args [ ] ) { System.out.println ( "hello" ) ; } The following String is not valid because there is an extra right curly brace: public class Exam { public static void main } ( String args [ ] ) { System.out.println ( "hello" ) ; } } You only need to verify the curly braces are matched correctly. You do not need to check for any other syntax errors in the code. As a hint, my solution contained 11 lines of actual code. As another hint, this problem is meant to use one of the data structures we discussed in this part of the course. Code that uses the data structure that provides the most efficient code (i.e fastest runtime) is eligible for full credit. Code that uses data structures with suboptimal runtimes is eligible for partial credit.