How to remove interior faces while keeping exterior faces untouched?

This worked like a charm. Greatly appreciate all of these great examples.