give an unsorted list and return the index of element if element existed in list, if element does not existed return the index of closest value
ex
input: [], value: 3 => return -1 becuase no element inside list
input: [1, 2, 3, 4, 5], value: 3 => return 2 # input[2] == 3
input: [11, 12, 13,1 5,1 5], value: 14 => return 2 # 1] does not exist, input[2] == 13 , input[3] == 15, index 2 < index 3
input: [11, 15, 13, 15, 11, 12, 13], value: 14 => return 1 # 14 does not exist, input[1] == 15, input[2] == 13, index 1 < index 2note: this question can be solve by sort the input list first and binary search to return the index. however if there is any way to solve with O(n) without sorting the list?