Fistful of Yojimbo
Sergio Leone was inspired by Akira Kurosawa who in turn was inspired by Dashiell Hammett.
I think Kurosawa had a solid leg to stand on when his studio sued (and won a settlement) with Leone over what was essentially an unlicensed remake.