Basically what the TraceTogether app in Singapore has already been doing in the past 2 weeks. Not rocket science, but a simple and clever approach still.
I don't know why Singapore GovTech hasn't yet released the source even after they said they intend to do so...