You are viewing a single comment's thread. Return to all comments →
If you got a problem with the test case 5 try with lexicographic order:
Set<String> hs = new HashSet<>(); for (int i = 0; i < t; i++) { String first = pair_left[i]; String second = pair_right[i]; if (first.compareTo(second) > 0) { String temp = first; first = second; second = temp; } hs.add(first + "," + second); System.out.println(hs.size()); }
Seems like cookies are disabled on this browser, please enable them to open this website
Java Hashset
You are viewing a single comment's thread. Return to all comments →
If you got a problem with the test case 5 try with lexicographic order: