Rotate Array

Medium · Arrays & Strings · about 15 minutes

Asked at Meta, Microsoft, ByteDance, Bloomberg, Google, Apple.

Given an integer array nums, rotate it to the right by k steps in place (k ≥ 0, and it may exceed the length), and return it.

Related guides