Getting WA in HOTEL

Can somebody please give a test case for which I am getting WA? In my code I have also added comments so that one can easily understand my logic. my code-http://www.codechef.com/viewsolution/4410524

  • 1
  • 7
  • 10 12 8 5 2 13 6
  • 11 15 9 6 9 19 18
  • excepted ans=3 but your output is 2. try to debug your code with the help of this test case :slight_smile:
1 Like