How did the octopus manage to beat the shark in a fight?

It was well-armed.