sir
when I compile the matrix search code i am getting the correct output but the compiler is displaying the run error
and also it displaying a success status though it is showing run error for all test cases
this is my code
#include
using namespace std;
int stairCaseSearch(int a[100][100],int ele,int rows,int columns){
int r=0;
int c=columns-1;
for(r=0;r<rows;r++){
if(a[r][c]>=ele){
while(a[r][c]>=ele&&c>=0){
if(a[r][c]==ele){
cout<<"1";
return 1;
}
c--;
}
c++;
}
}
cout<<“0”;
return 0;
}
int main(){
int a[100][100];
int rows;
int columns;
cin>>rows>>columns;
for(int i=0;i<rows;i++){
for(int j=0;j<columns;j++){
cin>>a[i][j];
}
}
int ele;
cin>>ele;
stairCaseSearch(a,ele,rows,columns);
return 1;
}