Left Rotation | Hackerrank Solution | Problem Solving | Data Structures - Arrays | C++ Solution

preview_player
Показать описание
In this video we will see full explanation of the problem Left Rotation, we will see both brute force and optimized approach along with code.

Do like, share and subscribe.

Рекомендации по теме
Комментарии
Автор

plz come live on YouTube sir u knownlegable trainer

MariyamVlogs
Автор

can you share the code of first approach

nikitasharma
Автор

#include <bits/stdc++.h>

using namespace std;

int main(){
int n, d;
cin>>n>>d;
int arr[n];
for(int i=0;i<n;i++){
cin>>arr[i];
}
int temp[n];
for(int i=0;i<n-1;i++){
temp[(i+(n-d))%n]=arr[i];
cout<<arr[i]<<endl;
}

return 0;
}
is there is any mistake

nikitasharma