June Lunch TIme 2020 Increasing Decreasing Help

Update: It was just a matter of Capitalization of “Yes” and “No” as part of the answer. Thank you for pointing it out.

Can someone please tell me what’s wrong with my solution for the lunchtime contest:


1 obvious thing that I first notice is that you have printed Yes instead of YES and No instead of NO, that will cause WA even if answer is correct


the cases of “Yes” and “No” is the only issue. Rest all seems fine.

Can someone please help me understand what am I missing in my solution.

Thanks a lot for that reply!! It’s the first time I’ve made that mistake. Seems really foolish.
I will be more careful next time

1 Like

There seems to be logical error(not too familiar with Python). But think of it this way: What are the conditions for which the answer will be NO. Let freq be an array storing the frequency of A_i for all i. Following two conditions will be case of NO

  • freq[max_A] > 1
  • freq[A_i] > 2 for any i

Apart from these two cases, the answer will be YES