Interview Question
Principal Software Engineer Interview
-
ApigeePrint unique strings in a array.
Interview Answers
2 Answers
▲
0
▼
Used HashSet to keep track of string that were already seen.
Anonymous on
▲
0
▼
1) Build a Trie and just then just walk and print it then... 2) Like above, use hash, however, this is challenging if you can have unbounded string... as definition of string.... char-sequence-until-null so potential input can one huge sequence.... if it is known that string can be resonably 256 char long at max and all english letter then you can make hash function.
Anon on
Add Answers or Comments
To comment on this, Sign In or Sign Up.