Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Deque RotateString
//g++ 7.4.0 //deque rotate string //original credit geeks for geeks #include <iostream> #include <deque> using namespace std; void rotate (deque<string > a, int d,int n) { for(int i=0; i<d; i++){ string val = a.back(); a.pop_back(); a.push_front(val); } for(int i=0; i<n; ++i) { cout<<a[i]<<" "; } cout<<endl; } int main () { deque<string> s={"Hi","There","How","Are","You","?"}; int n = s.size(); int d=2; rotate (s,d%n,n); return 0; }
run
|
edit
|
history
|
help
0
Problema Siruri
Find the Duplicate Number in array of n+1 integers having elements from 1 to n
PriQHotel
Riemann's prime number formula
count common elements in three sorted array without using extraspace
SEGMENTED SIEVE
segmentedSieveD
remove_copy-30-Seconds-of-C++
basic caculate ii
map sort