How to remove interior faces while keeping exterior faces untouched?

Thank you for that collection group of examples and that example of a multi level labyrinth is exactly what I’m trying to make.