(String left, String right)
| 6 | |
| 7 | // Return false if s.len < t.len condition is not met |
| 8 | private boolean createEdges(String left, String right) { |
| 9 | int minLen = Math.min(left.length(), right.length()); |
| 10 | |
| 11 | for (int i = 0; i < minLen; i++) { |
| 12 | char first = left.charAt(i), second = right.charAt(i); |
| 13 | |
| 14 | if (first != second) { |
| 15 | Set<Character> edges = this.adjList.get(first); |
| 16 | edges.add(second); |
| 17 | this.adjList.put(first, edges); |
| 18 | |
| 19 | Set<Character> revEdges = this.revList.get(second); |
| 20 | revEdges.add(first); |
| 21 | this.revList.put(second, revEdges); |
| 22 | |
| 23 | return true; |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | // No difference found yet, there is a problem |
| 28 | return (left.length() <= right.length()); |
| 29 | } |
| 30 | |
| 31 | private void initialize(String[] words) { |
| 32 | // Initialize |
no test coverage detected