For the students that can’t solve it in person, explain why cheating is bad and that they’re only hurting themselves, and give them a 0 on the exam. That’s probably enough for them to get the picture.
Also maybe focus on them a bit more, since they’re struggling. If someone cheated because they can’t do the assignment, then they’re struggling. So maybe offer them extra credit to make up for the exam if they come in after school to study with you where you can answer their questions.