We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Arrays: Left Rotation
- Discussions
Arrays: Left Rotation
Arrays: Left Rotation
Sort by
recency
|
4957 Discussions
|
Please Login in order to post a comment
Listans=new ArrayList(); int n=a.size();
for (int i = 0; i < n; i++) { ans.add(a.get((i+d)%n));
} return ans;
Python slicing 1 line solution: