Activity selection

Whats wrong with this code?

#include

using namespace std;

void activitySelect(int s[100], int f[100], int N){

int i = 0;

cout<<s[i]<<" "<<f[i]<<endl;

for(int j = 1; j<N; j++){
    
    if ((s[j] >= f[i]))
    {
        cout<<s[j]<<" "<<f[j]<<endl;
        i=j;
    }
    else
    {
        continue;
    }
    
    
}

}
int main(){

int s[10000], f[10000];
int t;
int N;
int n, m;

cin>>t;

while(t>0){
    cin>>N;
    int M = N;
    for(int k = 0; M>0; M--, k++){
        cin>>s[k];
        cin>>f[k];
    }
    
    activitySelect(s, f, N);
    
    t--;
}




return 0;

}

Hey @arjun.12narang
I replied u in other thread

if u want to discuss it further discuss on other thread ,closing this one :slight_smile:
.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.