Ring

Ring Distance

On a ring of length n where the ids are 0..n, what is the distance between two position u and v.

There will two 2 distance.

let (src, dst) = (u.min(v), u.max(v));
let d1 = dst - src;
let d2 = n - d1;

ABC376B