given two arrays A0, ..., AN and B0, ..., BN, with 0 ≤ Ai, Bi ≤ N. find for each 0 ≤ x ≤ 2·N. How can I solve this problem faster than O(N2)?
given two arrays A0, ..., AN and B0, ..., BN, with 0 ≤ Ai, Bi ≤ N. find for each 0 ≤ x ≤ 2·N. How can I solve this problem faster than O(N2)?