I have a 2060 and I am too afraid and poor to buy a 4090 after import duties and taxes in a tropical country
Edit: It looks like it can code, I tried to autocomplete the first 2 lines and it wrote the rest. Local Github Copilot here we come?:
//find index of element in sorted array in O(log(N)) time using binary search
int find_idx(int a[N], int element) {
int low = 0, high = N-1;
while (low <= high) {
int mid = (low + high) / 2;
if (a[mid] == element)
return mid;
else if (a[mid] < element)
low = mid + 1;
else
high = mid - 1;
}
return -1;
}