I've had problems with night time leg cramps for years. Some so bad I have to go for a walk in the middle of the night to ease them. I've been taking 99mg of potassium and 400mg of magnesium daily for several years and it's helped a lot but hasn't totally eliminated them. My brother swears by the pickle juice.
(The cramps on the inner thighs are the worst. Hard to stretch them out)