solution to artist pairs problem