Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • This is wildly inefficient, looping 650 times in your example above, and taking 35 seconds to execute 1000 invocations on my machine. For an alternative that loops just 11 times and takes less than 5 seconds to execute 1000 invocations, see my alternative answer. Commented Jul 28, 2018 at 17:20
  • 1
    Thanks, although that should be obvious just from looking at it. Perhaps the page faults are from the input size and the number of iterations you are executing. Nevertheless I like your solution.
    – JaredTS486
    Commented Aug 9, 2018 at 19:24