Its straightforward to accept a (n-1) length string with n states. But the issue is that since its a DFA, the last state should have transitions defined for it.
Already we’ve exhausted our ‘n’ states so we can’t add anymore states.
To define a transition for the final state, the only option is to have a transition to itself (self loop) OR to other states, causing a cycle. In both cases, we’d have a infinite language, since we can keep going round the loops/cycles to generate more and more, and thus, infinite strings, that the language can accept. You can try for n = 3 for example.