If post collect is 1 then redirect to the only article

So I would like to redirect users to the article is there is only 1 article in the collection.

So instead of showing “A collection of 1 post” then then the user having to click the only article, the user will be redirected automatically to the article.

What’s the best way of doing this?