A left rotation operation on an array shifts each of the array's elements unit to the left. For example, if left rotations are performed on array , then the array would become .
Given an array of integers and a number, , perform left rotations on the array. Return the updated array to be printed as a single line of space-separated integers.
Input Format
The first line contains two space-separated integers and , the size of and the number of left rotations you must perform.
The second line contains space-separated integers .
Constraints
Output Format
Print a single line of space-separated integers denoting the final state of the array after performing left rotations.
Name | Views | Likes |
---|---|---|
Arrays: Left Rotation using c++ | 726 | 1 |
C++ boost::ptr_container::ptr_set | 301 | 0 |
C++ Boost::scoped_exit | 397 | 0 |
C++ boost::ptr_inserter | 209 | 0 |
C++ Boost::ptr_container::ptr_vector.hpp | 313 | 0 |
C++ boost::shared_ptr | 620 | 0 |
C++ Boost Smart Pointers | 453 | 1 |
C++boost::simple_segregated_storage | 238 | 0 |
C++ Boost::object_pool | 223 | 0 |
OOP based programming using constructor, destructor, abstraction and encapsulation | 736 | 1 |
C++ boost::pool_allocator | 272 | 0 |
Vector-Sort | 609 | 0 |
Comments