You are viewing a single comment's thread. Return to all comments →
Resuelto
Set<String> obj = new HashSet<>(); for (int i = 0; i < t; i++) { String strKey = pair_left[i] +" "+ pair_right[i]; String strInvertKey = pair_right[i] +" "+ pair_left[i]; if(!obj.contains(strKey) && !obj.contains(strInvertKey)){ obj.add(strKey); } System.out.println(obj.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 →
Resuelto