Interesting. It was sodium for me. I had always heard potassium, so I ate bananas and potatoes and it got worse.
So I went the other way and started eating more salt. Pickles, straight salt, etc. Cured it quickly. I guess it’s actually sodium/potassium balance that is more important than either individually, and I wasn’t getting enough sodium.