UK - for a US passport validity is required
only to cover the length of your stay . (UK Governement advice)
Sweden - This requires validity of
3 months from the end of your trip (Swedish Government advice).
However, many airline check-in staff get antsy when a passport is close to expiry - and close means months not days - so you may have issues with airline check-in staff who will be risk averse.
Personally I always renew my passport at least 6 months in advance but in the UK we can have up to 9 months from an unexpired passport added to a new one but the US will likely have different rules.