This problem is in Contest(s) below:
Contest 1841:冒泡排序
Contest 1998:零基础第七节