Why is my code failing at large number of test cases? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why is my code failing at large number of test cases?

Here is my code : https://code.sololearn.com/cclpAc0qb4aS/?ref=app This is the solution of Hackerearth - Codemonk 'Monk being monitor' problem.

3rd Aug 2021, 5:24 PM
Meghraj
Meghraj - avatar
6 Answers
+ 7
Meghraj , if you really need help, you should: ▪︎post the complete task description here or the link to this exercise, containing also samples of input and output. ▪︎in some platforms you get a message or a hint about the reason why you are failing: syntax error, exceptions, when the execution is timed out or when memory consumption is too high. any hint will help. thanks
3rd Aug 2021, 6:12 PM
Lothar
Lothar - avatar
+ 2
Meghraj , any comments or messages from the system why you have failed?
4th Aug 2021, 7:30 PM
Lothar
Lothar - avatar
+ 1
Meghraj Please copy and paste the question here.
5th Aug 2021, 6:47 AM
Calvin Thomas
Calvin Thomas - avatar
0
what is purpose of n = int(input()) it is not being used anywhere. try to remove it.
3rd Aug 2021, 5:40 PM
▬▬▬
▬▬▬ - avatar
0
Lothar https://www.hackerearth.com/practice/codemonk/ This is the link to the exercise named 'Monk being Monitor'. Would really appreciate some help :)
4th Aug 2021, 5:01 PM
Meghraj
Meghraj - avatar
0
Lothar the code is accepted for the first test case but at large number of cases it shows 'wrong answer'. The code is okay, there are no errors and works really good for lesser cases
5th Aug 2021, 2:42 AM
Meghraj
Meghraj - avatar