You are given two integer arrays A and B.