We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Java
- Data Structures
- Java Hashset
- Discussions
Java Hashset
Java Hashset
Sort by
recency
|
346 Discussions
|
Please Login in order to post a comment
//ANSWER //Write your code here
//ANSWER //Write your code here HashSet set= new HashSet<>(); int count=1; for(int i=0;i
Simple and straight-forward O(n) solution. After nextInt the nextLine is used else our scanner reads the buffer left after reading the number of pairs as first pair.