i don’t understand why i am getting run time error while submitting the code in pyhton 3 although it is sucessfully executed…here is the link to my solution to the TRAINSET (begginer) problem
When running your solution with the following test input:
1
5
cfaj 1
cfaj 1
cfaj 1
cfaj 1
cfaj 1
I got the error:
Traceback (most recent call last):
File "./swati_ubnare-TRAINSET.py", line 14, in <module>
w,b = j.split('')
AttributeError: 'list' object has no attribute 'split'
Edit:
In fact, trying your solution with the sample test input has the same result.
sorry, i put the wrong link …my code is showing TLE here is the right code…
i have done some changes to the code …
yes …this code is giving correct output…but it is showing Time limit exceeded
Yes, you have to use a bit of ingenuity and come up with a much faster approach
Incidentally, the current approach is still incorrect, I think: for the testcase:
1
10
gkd 1
gkd 1
gkd 1
j 1
gkd 1
j 0
j 0
gkd 1
j 0
aa 1
I get the answer 9
.
1 Like