Rotate in place
Rotate a vector right by k positions without allocating another vector.
The C++ practice arena
Write or upload C++17, edit your own visible cases, then submit against hidden tests. Passing solutions get real runtime, memory, and a playful percentile.
One attempt, three steps
01Write
Use the editor or upload a .cpp file.
02Run
Compare visible input and output.
03Submit
Face hidden cases and record the result.
Drafts stay local. Verified progress syncs to your account.
Rotate a vector right by k positions without allocating another vector.
Arena progress
0/22
Filter by topic or search for a technique.
Challenge queue
22 shown
Rotate a vector right by k positions without allocating another vector.
Find the maximum sum of a non-empty contiguous subarray, including when every value is negative.
Find the length of the longest substring with no repeated character.
Decide whether two lowercase strings contain exactly the same characters with the same frequencies.
Validate (), [], and {} while reporting the first bad index.
For every array element, find the first greater element to its right.
Process PUSH, POP, and FRONT commands while handling an empty queue safely.
Return the first array value whose frequency reaches two.
Find the first occurrence of a target in an unsorted array, or report that it is absent.
Return the first index of target in a sorted array containing duplicates.
Given workloads and h hours, find the smallest integer speed that finishes all work.
Locate a key in a strictly increasing array rotated at an unknown pivot.
Run insertion sort conceptually and count how many right-shifts are required to sort the array.
Count pairs i<j with a[i]>a[j] without checking all pairs.
Find the kth smallest element without fully sorting the input.
Validate a serialized binary tree using ancestor bounds rather than checking only each parent.
Check whether an array representation satisfies the min-heap order property at every parent.
Report the kth largest value after every item in a stream.
Count connected components in an undirected graph and label every vertex.
Detect a cycle in a directed dependency graph.
Compute the shortest distance from one source to every vertex in a non-negative weighted graph.
Process union and connected queries using path compression and union by size.