Reverse in Groups
Medium · rating 1350 · Arrays
The first line has n and k. The second line has n integers. Reverse the array in contiguous groups of k (a final group smaller than k is reversed as-is). Print the result, space-separated.
Constraints: 1 ≤ k ≤ n ≤ 105
Related problems
- Count Pairs With Sum — Medium
- Count Pairs With Difference — Medium
- Count Pairs with Sum — Medium
- Find the Duplicate — Medium
- Maximum Subarray Sum — Medium
- Maximum Window Sum — Medium