On May 9, 9:57 pm, Brian Watkins <wildu...@gmail.com> wrote: > I can see O(N log r), but O(N) seems pretty tough.
http://pastebin.com/z8h82e99 is a Python implementation of the O(N) algorithm. The difference is in the jump table calculation: instead of calculating each entry independently, use a moving pointer that runs ahead. Marco -- You received this message because you are subscribed to the Google Groups "google-codejam" group. To post to this group, send email to google-c...@googlegroups.com. To unsubscribe from this group, send email to google-code+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-code?hl=en.