FFORGE//RS
← Roadmap

rust / LEVEL 3

The replica event matched twice

EST.35 MIN
01

THEORY / RETRIEVAL

What to restore

  • Recognize when sorted inputs permit a two-pointer scan
  • Advance the side that can no longer match the opposite cursor
  • Use overflow-safe distance and preserve one-to-one matching

Sorted inputs turn discarded prefixes into proof

If the current left timestamp is earlier than the current right timestamp by more than the tolerance, it cannot match that right event or any later one. Advancing only left discards a proven-impossible prefix. The symmetric rule applies to right, so each cursor moves at most N or M times.

A match consumes both events

Matching the earliest feasible pair and advancing both cursors gives a deterministic maximum-cardinality matching for two sorted timestamp streams under one absolute-distance threshold. `u64::abs_diff` expresses the distance without underflow at either numeric extreme.

CHECKPOINT

left[i] is earlier than right[j] by more than the tolerance. Both inputs are sorted. Which cursor movement is justified?

ISOLATED RUST 1.96
src/lib.rsEDIT

02 / DEBUGGING

Find and fix the defect

Repair `reconcile_events`. Inputs must be nondecreasing or return the side-specific error. Return earliest one-to-one index pairs whose timestamps differ by at most tolerance in O(left.len()+right.len()) time. Do not mutate or clone either input.

Initializing editor…
CLOUD SANDBOXnetwork off · 256 MB · 12 s
1 / 64 KB
OUTPUT
Runner is waiting for a submission.