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
|
388 Discussions
|
Please Login in order to post a comment
The Solution for the Problem is
Test case #5 is wrong, At least it's conflicted with this problem's desc.
how solve this i failed from 1/6 test cases there is error show in test case 5 import java.io.; import java.util.; import java.text.; import java.math.; import java.util.regex.*;
public class Solution {
public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); String [] pair_left = new String[t]; String [] pair_right = new String[t];
// ... your previous code unchanged ... Set hashSet = new HashSet<>(); for (int i = 0; i < t; i++){ hashSet.add(pair_left[i]+" "+pair_right[i]);hoow System.out.println(hashSet.size()); } } }
Test case 5 is wrong. I want them to fix it.
Here is java Hashset solution - https://programmingoneonone.com/hackerrank-java-hashset-problem-solution.html