It was a struggle that lasted three fraught years.

While Prime Minister Theresa May (just about) won a general election and saw off leadership challenges, she repeatedly failed to win big on Brexit by passing her Withdrawal Agreement.

And now Mrs May is stepping down, but how did she get here?