MCPcopy Index your code
hub / github.com/Hazrat-Ali9/Computer-Programming / isValid

Method isValid

Problem11.java:54–67  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

52 }
53
54 static boolean isValid(String s) {
55 boolean res = true;
56 for (int i = 1; i < s.length() - 1; i++) {
57 if (s.charAt(i) == 'R' || s.charAt(i) == 'L') {
58 if (isDigit(s.charAt(i - 1)) && isDigit(s.charAt(i + 1))) {
59 res = true;
60 } else {
61 res = false;
62 return res;
63 }
64 }
65 }
66 return res;
67 }
68
69}

Callers 1

mainMethod · 0.95

Calls 1

isDigitMethod · 0.95

Tested by

no test coverage detected