91 ms·
If dictionary lookup is O(1), we could just make a dictionary of all the doubled words? Now the whole problem is O(1)!
by bolanyo 3y ago
If dictionary lookup is O(1), we could just make a dictionary of all the doubled words? Now the whole problem is O(1)!
- pcthrowaway 3y agoBut making that is O(n^2) time and space, where n is the size of the dictionary