I am having a similar problem some test cases go wrong can someone suggest me the solution.
This is my code:
#include<bits/stdc++.h>using namespace std;int main(){int n, k;cin >> n >> k;int a[n];// int r = n;for(int i = 0; i < n; i++){cin >> a[i];}int bak[n];int y = 0;for(int i = 0; i < n; i++){if(a[i] > 0)
Read more… (21 words)