  We introduce a novel physical mechanism for achieving giant quality factors
($Q$-factors) in finite-length periodic arrays of subwavelength optical
resonators. The underlying physics is based on interference between the
band-edge mode and another standing mode in the array, and the formation of
spatially localized states with dramatically suppressed radiative losses. We
demonstrate this concept for an array of $N$ dipoles with simultaneous
cancellation of multipoles up to $N$-th order and the $Q$ factor growing as $Q
\propto N^{\alpha}$, where $\alpha \gtrsim 6.88$. Based on this finding, we
propose a realistic array of Mie-resonant nanoparticles ($N \lesssim 29$) with
a dramatic enhancement of the Purcell factor (up to $\sim $3400) achieved by
tuning of the array parameters.
