  MDS codes have diverse practical applications in communication systems, data
storage, and quantum codes due to their algebraic properties and optimal
error-correcting capability. In this paper, we focus on a class of linear codes
and establish some sufficient and necessary conditions for them being MDS.
Notably, these codes differ from Reed-Solomon codes up to monomial equivalence.
Additionally, we also explore the cases in which these codes are almost MDS or
near MDS. Applying our main results, we determine the covering radii and deep
holes of the dual codes associated with specific Roth-Lempel codes and discover
an infinite family of (almost) optimally extendable codes with dimension three.
