You could do all of that (and TBH I probably would - there's a reason I call them deletes) but if I actually wanted to do what you are asking here's what I'd do (on a Mac, other operating systems are available).
1. Make sure folder A is in Lightroom (rejects aren't always)
2. Go to the terminal, navigate to folder B and type "ls > dir.txt" without quotes
3. Back in a GUI editor open up the file dir.txt - it will contain a list of all the files in folder B (plus a bit of junk but that's irrelevant)
4. Edit the file so that the file names are separated by commas not paragraph marks (e.g. in Word or similar replace all paragraph marks with comma space)
5. Select the list and copy to clipboard
6. Go into LR and navigate to folder A, use text find for filename contains and paste the list
7. Invert selection.
But next time, MOVE the pics from folder A to folder B. And then delete folder A