Elon Musk has succeeded in getting out of his agreement to purchase Twitter after months of trying to do so.