• + 0 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());
            }