I just wonder, when did humans start to build and live in apartments?
The earliest examples I know are the Roman Insula.
While there might be earlier examples, apartment buildings as we know them need strong courts and laws to exist for speculators to build them, and Rome might be the first to have that.