My issue
2 4 6 8 10
My code
# Initial array
arr = [2, 4, 6, 8, 10]
size = 5 # Current size of the array
position_to_delete = 2 # Index of the element to delete
# Shift elements to fill the gap left by the deleted element
# Update the size of the array
# Print the updated array
for i in range(size):
print(arr[i], end=" ")
Learning course: Data Structures & Algorithms using C
Problem Link: https://www.codechef.com/learn/course/city-dsa-c/CITYDSC01/problems/DSAAGP08