Implement a binary search algorithm in R to find an element in a sorted vector.
HardProblem Statement
Implement a binary search algorithm in R to find an element in a sorted vector.
Sample Input
Vector: c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10) Target: 7
Sample Output
Element found at index: 7
Limits
Time: 2s · Memory: 256 MB