vector deleteElement(int A[], int L, int R, int N)
{
vector B;
for (int i = 0; i < N; i++)
if (i <= L || i >= R)
B.push_back(A[i]);
return B;
}
// main Driver
int main()
{
int A[] = { 3, 5, 3, 4, 9, 3, 1, 6, 3, 11, 12, 3 };
int L = 2, R = 7;
int n = sizeof(A) / sizeof(A[0]);
vector res = deleteElement(A, L, R, n);
for (auto x : res)
cout << x << " ";
return 0;
}
3.Deque ning barcha elementtlarini qanday olib tashlash mumkun ?
int main()
{
deque mydeque{ 1, 2, 3, 4, 5 };
mydeque.clear();
// Deque becomes empty
// Printing the deque
for (auto it = mydeque.begin(); it != mydeque.end(); ++it)
cout << ' ' << *it;
return 0;
}