You can sort the strings based on increasing or decreasing lexicographic order. Then, you can easily find the duplicate string by iterating over the set once, and checking if any two consecutive strings are the same or not.
Now, everything boils down to the sorting algorithm that you want to use. Consider these two popular options:
If you use Merge sort, it would take $O(N \log N)$ comparison operations. Since the length of each string is at most $n$, a comparison operation would take $O(n)$ time. Thus, the sorting takes $O(n \cdot N \log N)$ time.
You can also use Radix sort. It would take $O(n \cdot N)$ time. This is similar to the approach that is suggested by gnasher729. I am just explicitly mentioning the name of this technique.
It is easy to see that Radix sort is giving a better time complexity of $O(n \cdot N)$. Lastly, iterating over the entire set once and checking if any two consecutive strings are the same, takes $O(n \cdot N)$ time. Thus, the overall time complexity is $O(n \cdot N)$.