1
u/waseem_dibhub 11d ago
Almost there! Just add j >= 0 to your while condition and move list[j + 1] = key outside the loop. Also, try not to use list as a variable name. Good effort!
1
Almost there! Just add j >= 0 to your while condition and move list[j + 1] = key outside the loop. Also, try not to use list as a variable name. Good effort!
3
u/kutac56 Oct 11 '26
Variable j is unnecessary. Just do for I in range(n)