Skip to content

Files

Latest commit

 

History

History

countrotations

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Description

Given an array of distinct integers sorted in increasing order. The array has been rotated (clockwise) k number of times. Find the value of k.

Example 1:

Input: {15, 18, 2, 3, 6, 12}
Output: 4

Example 2:

Input: {7, 9, 11, 12, 5}
Output: 1

Example 3:

Input: {7, 9, 11, 12, 15};
Output: 0