You are viewing a single comment's thread. Return to all comments →
public class Solution {
public static void main(String[] args) { Scanner sc = new Scanner(System.in); int i = sc.nextInt(); HashSet<String> hs = new HashSet<>(i); String c; while(i>0){ c = sc.next(); hs.add(c.toLowerCase()); System.out.println(hs.size()); i--; } }
}
Seems like cookies are disabled on this browser, please enable them to open this website
I agree to HackerRank's Terms of Service and Privacy Policy.
Java Hashset
You are viewing a single comment's thread. Return to all comments →
public class Solution {
}