CSDN每日一练_1(20220212)有效的括号
package day04.first;
import java.util.Stack;
public class Solution {
public static void main(String[] args) {
String str = "(124546{[})";
boolean a = isValid(str);
System.out.println(a);
}
public static boolean isValid (String s){
//定义左括号和右边的括号
char [] parentheses = { '(' , '[' , '{' , ')' , ']' , '}'} ;
int i= 0 ;
char c ;
int [] sum = {0,0,0};
Stack
共有 0 条评论