SKYou did a mistake in the first for loop where you get the input it should be cin>>arr[i] and in the second for loop initialize the i as s-1 it will workComment·Thread·Jul 26, 2020·Struck at a Basic competitive programming question