I guess I have a python script for it (python is easy to use; it is included in most Linux distributions and may be installed on many platforms (in particular, a quick installation on windows is available). For more details see
www.python.org).
In fact, the script allows to determine the intersection of or the difference between any two categories (Special:Allpages included). So if you are interested in it, please send me a personal mail on this forum (just click to see my profile and scroll down to Additional Info). I'd readily share it but I don't think that publishing the code would be the best solution now.