Can you tell me which test case it is failing?

I am writing solution for but it is giving WA on 10th test case. Here is my code:

#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
	// your code goes here

	int n;
	int a[n];
	for(int i=0;i<n;i++)
    return 0;

You have overlooked two important cases, I think.

Firstly if N=1, your program will print N-2, which is equal to -1, while the answer should be 0.

Another case that you haven’t considered is that two or more stewards can have the same value.
For example, if N=3, and the stewards have values: 4,4,4; your program will print 1, while the correct answer is 0.

Hope this was helpful.

1 Like

thanks for your time…

1 Like