Should I repost this question without the inappropriate content? Or is editing and requesting undeletion the way to go? Editing that question would invalidate its answer.
Moderators won't undelete the original so you can edit.
Nor would they have to: even though it's deleted, it wasn't self-deleted, so you could still edit it to get it to a state where it was suitable for undeletion.
But I suspect any edit sufficient to salvage that question would turn it into a new question entirely and invalidate the existing answer.
If you think you can salvage an appropriate puzzle out of the original, you're really making a new puzzle, so post it as such. I'll note that the original was deleted because it was a trivial puzzle that looked like nothing more than a pretext to post the inappropriate content; I'd strongly caution you to ensure its refit is much less "edgy" and much more "puzzle".