Suppose we have two finite sets $A,B\subset\mathbb Z$. I am interested in an upper bound on the number of translations of $B$ by integers that have nonzero intersections with $A$ i.e. $$T(A,B):=\lvert\{k\in\mathbb Z~|~A\cap(B+k)\not=\emptyset\}\lvert.$$
One obviously has $T(A,B)\leq\text{diam}(A)+\text{diam}(B)-1$ where diam denotes the diameter of a set. I was wondering: What is a good bound on $T(A,B)$ in terms of $\lvert A\lvert$ and $\lvert B\lvert$?