MCPcopy Create free account
hub / github.com/Tiwarishashwat/InterviewCodes / isSame

Method isSame

ValidParenthesis.java:17–26  ·  view source on GitHub ↗
(char str, char stk)

Source from the content-addressed store, hash-verified

15 }
16
17 public boolean isSame(char str, char stk)
18 {
19 if(isOpen(stk))
20 {
21 if(str=='}' && stk=='{') return true;
22 else if(str==')' && stk=='(') return true;
23 else if(str==']' && stk=='[') return true;
24 }
25 return false;
26 }
27
28 public boolean isValid(String s) {
29

Callers 1

isValidMethod · 0.95

Calls 1

isOpenMethod · 0.95

Tested by

no test coverage detected