diff options
author | William Carroll <wpcarro@gmail.com> | 2020-11-14T15·28+0000 |
---|---|---|
committer | William Carroll <wpcarro@gmail.com> | 2020-11-14T15·28+0000 |
commit | a0e9e2b310697c1d14093f9df354284689c332ea (patch) | |
tree | 3cf5d3ff9aff6ee312c205b2c477f554370d039f /scratch/facebook/moderate/rand7.py | |
parent | 48fde5f27838b63d33fe69eb5f13f5d54314555d (diff) |
Solve unsorted-substring a second time
This solution operates in O(n) time instead of O(n*log(n)) time, which surprisingly isn't *that* big of a difference... Consider a size of n of 10M... 1) ~10s 2) ~0.5s So, yes, the O(n*log(n)) will take 100x longer to complete, but for an enormous input size of 10M elements, it can still complete in under a minute. The difference between that and the second, faster, algorithm, is just 9s.
Diffstat (limited to 'scratch/facebook/moderate/rand7.py')
0 files changed, 0 insertions, 0 deletions