We can arrange N persons in a row in N! ways.
We assume two particular cadets as one. ∴ Remaining (N - 1) persons can be arranged in (N - 1)! ways.
Also, these 2 cadets can be arranged themselves in 2! ways.
Therefore, P (2 particular cadets standing side by side) =N!(N−1)!×2!=N2