|
@@ -1,4 +1,33 @@
|
1
|
1
|
package io.zipcoder;
|
2
|
2
|
|
3
|
3
|
public class ParenChecker {
|
|
4
|
+
|
|
5
|
+ public boolean pairChecker(char a, char b) {
|
|
6
|
+
|
|
7
|
+ if(a == '(' && b == ')') {
|
|
8
|
+
|
|
9
|
+ return true;
|
|
10
|
+
|
|
11
|
+ } else if (a =='{' && b == '}') {
|
|
12
|
+
|
|
13
|
+ return true;
|
|
14
|
+
|
|
15
|
+ }else if (a == '<' && b == '>') {
|
|
16
|
+
|
|
17
|
+ return true;
|
|
18
|
+
|
|
19
|
+ }else if(a == 34 && b == 34) {
|
|
20
|
+
|
|
21
|
+ return true;
|
|
22
|
+
|
|
23
|
+ }else if(a == 39 && b == 39) {
|
|
24
|
+
|
|
25
|
+ return true;
|
|
26
|
+
|
|
27
|
+ }else{
|
|
28
|
+
|
|
29
|
+ return false;
|
|
30
|
+ }
|
|
31
|
+
|
|
32
|
+ }
|
4
|
33
|
}
|