Dun & Bradstreet Interview Question

Similar to a 2 sum problem