I was playing it on an emulator the first time, so I just saved the state at the start of the battle. I lost the first time, but I won after a few tries.