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
|
422 Discussions
|
Please Login in order to post a comment
Test 5 only works if you disregard this and do the opposite.
Test case 5th is incorrect: - Duplicate 191 / 259 ...
Test case 5 says there are 975 unique strings. I copied the data into Excel and ran this macro: =COUNTA(UNIQUE(D1:D1000)) The macro counted 990 unique strings.
I also ran the code in my IDE and it reported 990 unique strings, verifying Excel's findings.
It looks like this has been a known problem for a long time. I guess no one at HackerRank monitors this chat channel.
UPDATE: I copy/pasted the code from the Editorial tab. It also failed on test case 5.
It seems that the test #5 is not counting the pair on line 192 because it was added before but swapped. I guess that's an error on testing...