pull a rabbit out of the hat

idiomPart ofrabbit

pull a rabbit out of the hat — idiom

1. to suddenly produce an unexpected solution to a difficult problem, as if by magi

1.idiom
Definition

to suddenly produce an unexpected solution to a difficult problem, as if by magic.

Example

With the company about to go bankrupt, the CEO pulled a rabbit out of the hat and secured a huge investment from an overseas partner.