Peeush Agarwal > Engineer. Learner. Builder.

I am a Machine Learning Engineer passionate about creating practical AI solutions using Machine Learning, NLP, Computer Vision, and Azure technologies. This space is where I document my projects, experiments, and insights as I grow in the world of data science.

View on GitHub

Rotate Array

Problem Description

Given an integer array nums, rotate the array to the right by k steps, where k is non-negative.

Examples

Example 1:

Example 2:

Constraints

Follow Up

Code Template

class Solution:
    def rotate(self, nums: List[int], k: int) -> None:
        """
        Do not return anything, modify nums in-place instead.
        """
        # Write your code here
        pass

Solutions

Back to Problems List Back to Categories