Created
March 2, 2019 19:52
-
-
Save hmenn/22e1efc93beac003e63a3f10887aae87 to your computer and use it in GitHub Desktop.
hackerrank - intertiew kit - arrays
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Complete the rotLeft function below. | |
vector<int> rotLeft(vector<int> a, int d) { | |
std::vector<int> v; | |
for(int i=0; i<a.size();++i){ | |
v.push_back(a[(i+d)%a.size()]); | |
} | |
return v; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment