Skip to content

Instantly share code, notes, and snippets.

@piusayowale
Created June 9, 2022 21:30
Show Gist options
  • Save piusayowale/0c4d53543d75b60248326c8924ab5222 to your computer and use it in GitHub Desktop.
Save piusayowale/0c4d53543d75b60248326c8924ab5222 to your computer and use it in GitHub Desktop.
vector<int> rotLeft(vector<int> a, int d) {
vector<int> temp(a.size());
int i = 0;
for(i = 0; d+i < a.size(); i++){
temp[i] = a[d+i];
std::cout << temp[i];
}
int t = 0;
while(i < a.size()){
temp[i] = a[t];
i++;
t++;
}
return temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment