Unquestionably. The denser the housing the more environmentally friendly, they are nearly perfectly correlated. Shared walls share thermal mass, which helps on both the hot and cold end. Shared facilities reduce per-unit square footage, further saving on heating/cooling. Network-effects of density cause more things to be in walkable/bikeable distance. Substantial density is required to make public transit function.
As an example, check out the map of the boston-washington/east-coast-corridor of the US here: https://coolclimate.org/maps
As opposed to packing people like ants in high-rises in cities, which is the most environmentally friendly?