04(March) Swap the array elements
04. Swap the array elements
My Approach
Time and Auxiliary Space Complexity
Code (C++)
class Solution{
public:
void swapElements(int arr[], int n){
for(int i = 0; i < n-2; i++){
swap(arr[i], arr[i+2]);
}
}
};Contribution and Support
📍Visitor Count
Last updated