How to relieve Charlie Horse in legs and feet

What kind of food or exercise will relieve Charlie Horse and cramps in legs and feet?

Bannas they have potassium and it helps with cramps try and eat 2or 3 a day