Selection Sort Doubt in my code

Hey I have written a code by my own in which in select method if i put i<n-1 last element is not in its right position but in video it is i<n-1 rather than i<n

@devfest2021_ca0dcbd15233fafb In video for outer loop mam has used i < n-1 but for inner loop mam has used j <= n-1 not j < n-1 and j <= n-1 can also be interpreted as j < n.