You are given a sorted array of n unsigned 8-bit integers (uint8_t) and a key to search. Your task is to:
Important:
Example-1
Input: n = 6, arr = [5 10 15 20 25 30], key = 20
Output: 3
Example-2
Input: n = 5, arr = [2 4 6 8 10], key = 1
Output: -1
Example-3
Input: n = 4, arr = [100 150 200 250], key = 250
Output: 3
Input
6 5 10 15 20 25 30 20
Expected Output
3