ex 1 et 3 en cours (todo ex 2)

This commit is contained in:
trochas
2025-12-05 09:55:50 +01:00
parent 7155dd77be
commit d6bd1db6bc
4 changed files with 47 additions and 0 deletions

View File

@@ -5,7 +5,17 @@ public class StringUtils {
private StringUtils() {}
public static boolean isBalanced(String str) {
return false;
}
public static String reqIsBalanced(String str){
String all = "[\\[\\(\\{\\]\\)\\}\"]";
String openRegex = "[\\[\\(\\{\"]";
String closeRegex = "[\\]\\)\\}\"]";
String regex = "^[^"+all+"]*"+openRegex+"."+closeRegex+"^["+all+"]*";
return str;
}
}

View File

@@ -8,4 +8,12 @@ import static org.junit.jupiter.api.Assertions.*;
class StringUtilsTest {
@Test
public void test2(){
//assertEquals(num1,num2);
String s = "te";
String s2 = "test";
s += "st";
assertSame(s2,s);
}
}