2 ms·
How could you do this in O(1)? Or are you saying you can get a probably right answer in O(1)?
by mdwrigh2 16y ago
How could you do this in O(1)? Or are you saying you can get a probably right answer in O(1)?
- swolchok 16y agoIt's impossible to do in O(1) in the worst case, because you have to at least examine all the input (e.g., if the input matches the regex AA*B.)