I don’t know enough about the details to be sure … but I wonder if some or all of the former Kowloon Walled City could have been considered a single highly populated building.
The diagram below indicated “500 buildings”, but I get the impression that many of these various buildings sort of “coalesced” into a much smaller number of “super-structures” over the years.