Hi Tanya,
I'm Sumit, here to answer your query at the Microsoft Community.
No, you are not hacked.
Lately, customers have reported getting single-use codes on their Phones and Emails for their Microsoft Account Sign-in. It is unclear whether this is a bug from Microsoft or that some hacking group is involved. I came across a Reddit thread that discusses the same issue you mentioned.
https://www.reddit.com/r/Office365/comments/15d...
Rest assured, if you have 2 Factor Authentication turned on and Microsoft Authenticator is installed on your Phone, your account is nearly impossible to hack.
Questions? We are always here to help you.
Disclaimer:
The link included is a non-Microsoft website that would provide accurate and safe information. Watch out for ads on the site that are frequently classified as PUP (Potentially Unwanted Products). There is no need to buy paid products to fix your computers as they sometimes do more harm than good.