Unable to solve chef in fantasy league...can anyone help please?

his is my code which is giving runtime error…CodeChef: Practical coding for everyone?

You did not take the case that, if the the second array contains just 1’s or just 0’s or if n=1, then it should be “no”. And you are trying to access 1st element of an empty vector, hence results in runtime error.
Modified AC code

1 Like