TikTok Interview Question

Count number of rotated elements in a rotated sorted array.