Dropping the second definite article in that sentence represents a form of ellipsis. Briefly, ellipsis is
the omission, from a clause, of one or more words that are nevertheless understood in the context of the remaining elements.
So your sentence may be stated fully or with one or more elements removed—it doesn't matter which as long as the resulting statement is easily understood. Note, however, that use of ellipsis is a shade less formal than making a complete statement. That doesn't make it bad, however, and oftentimes even in formal prose the elliptical statement may be preferred because it seems more natural than a "complete" one.