(String s1, String s2)
| 10 | } |
| 11 | |
| 12 | public static boolean isRotation(String s1, String s2) { |
| 13 | int len = s1.length(); |
| 14 | /* check that s1 and s2 are equal length and not empty */ |
| 15 | if (len == s2.length() && len > 0) { |
| 16 | /* concatenate s1 and s1 within new buffer */ |
| 17 | String s1s1 = s1 + s1; |
| 18 | return isSubstring(s1s1, s2); |
| 19 | } |
| 20 | return false; |
| 21 | } |
| 22 | |
| 23 | public static void main(String[] args) { |
| 24 | String[][] pairs = {{"apple", "pleap"}, {"waterbottle", "erbottlewat"}, {"camera", "macera"}}; |
no test coverage detected