This problem is just another balancing act for me.
Say we have 50 human beings. That makes 50 heads and 100 legs. This means that we have 24 horses to round it off. This adds 24 heads and 96 legs.
Add them up, and we have 74 heads and 196 legs. 50 humans and 24 horses is your answer.
I really, honestly don't know how I got this first try, but if you missed your first attempt, you can retry based on how many legs you are off by. If you have too many, add more humans. If you are missing some, add some more horses.