Problem Submissions Solution

Find Kth Rotation

Difficulty: Easy

Acceptance: %

Points: 20.00

Given an increasing sorted rotated array arr of distinct integers. The array is right-rotated k times. Find the value of k.

Let's suppose we have an array arr = [2, 4, 6, 9], so if we rotate it by 2 times so that it will look like this:

After 1st Rotation : [9, 2, 4, 6]

After 2nd Rotation : [6, 9, 2, 4]

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(log n)

Expected Space Complexity: O(1)

Constraints:
  • 1 <= n <= 10^5
  • 1 <= arr[i] <= 10^7
Companies:
Amazon Accenture ServiceNow Flipkart
Topics:
Array Stack Searching Algorithm
Locked Content
Access Restricted: Please Login to access the code editor and test cases.