index of the element in the array

This Question Was Asked By Amazon

A sorted array of integers was rotated an unknown number of times.
Given such an array, find the index of the element in the array is faster than linear time. If the element doesn't exist in the array, return null.

Write a function solve that have the following parameter(s):
1.) a = a string
2.) k = an integer

Example
Input:
arr = [13, 18, 25, 2, 8, 10] k = 8 Output:
4

Explanation
An array of [13,18,25,2,8,10] is given have to find the index of 8 so, it will return 4.

Example
Input:
arr = [10, 13, 25, 8, 2, 65] k = 10 Output:
0

Explanation
An array of [10, 13, 25, 8, 2, 65] is given have to find the index of 10 so, it will return 0.

Constraints
• The length of an array should be greater than 0 and less than 1000.
• The elements of an array should be greater than 0 and less than 1000.