Here is an algortihm:
1 - order letters in target word (chocolate --> accehloot)
2 - order letters in check word (hoot --> hoot

ops! a no brainer example!)
3 - seek for common letters and "cross off" as you go through.
While step 2 may not be necessary - it might make stepping through the words easier.
I haven't tried coding this - but I am sure that some of those more expereinced than I could make a quick code up :-)
Cheers,
DK