Pergunta de entrevista da empresa Spotify

Given a sorted now. Now the array is rotated. Find the rotation index. Example : [5,4,1,2,3] . Index : 2 (value :1)