Domanda di colloquio di Perficient

Print all duplicates in a string array.

Risposta di colloquio

Anonimo

20 lug 2018

2 for loops (O(n^2)) time complexity. Marginally better would be to keep a track of the positions in the string array where reputation/duplication occurs, and skip those positions for future passes. Another way would be to use a hash map.

1