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.
- Prepare
- Data Structures
- Arrays
- Left Rotation
- Discussions
Left Rotation
Left Rotation
Sort by
recency
|
3509 Discussions
|
Please Login in order to post a comment
O(1) time vector rotateLeft(int d, vector arr) { vector result; int step = d % arr.size();
}
Time Complexity: O(n) <\br>
Space Complexity: O(n)
Here is my one line Python solution!
Here is my c++ solution, you can have the video explanation here : https://youtu.be/lyUDSB4Sg7Y