Find a middle edge in linear space

Sign in to test your solution.