1.
程序1: for循环的i>0改为i>=0;
程序2: for循环for (int i = 0; i < x.length; i++)改为for (int i = x.length-1; i > = 0; i--)
2.
程序1:x=[1,2,3], y=2; expected = 1
程序2:x=[0,1,2]; expected = 0
3.
程序1: x=[1,2,3],y=4; expected=-1;
程序2:x=[1,2,3]; expected=-1;
4.
程序1:x=[1,2,3], y=2; expected = 1
程序2:x=[0,1,2]; expected = 0