What’s the error in my solution of CSES-Apartements Question Solution
#include <iostream> #include <algorithm> using namespace std; bool search(int c,int arr[],int d,int m){ int a=0; int b=m-1; while(a<=b){ int k = (a+b)/2; if((arr[k]>c-d && arr[k]<c+d)||(d==0 && arr[k]==c)){ return true; } if(arr[k]>=c+d) b = k-1; else a = k+1; } return false; } int main(){ int n,m,k; cin>>n>>m>>k; int dsize[n]; int asize[m]; for(int i=0;i<n;i++){ cin>>dsize[i]; } […]