about summary refs log tree commit diff
path: root/scratch/facebook/moderate/rand7.py
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-11-14T15·28+0000
committerWilliam Carroll <wpcarro@gmail.com>2020-11-14T15·28+0000
commita0e9e2b310697c1d14093f9df354284689c332ea (patch)
tree3cf5d3ff9aff6ee312c205b2c477f554370d039f /scratch/facebook/moderate/rand7.py
parent48fde5f27838b63d33fe69eb5f13f5d54314555d (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