Runtime error for SWPDGT

Here’s the solution :
https://www.codechef.com/viewsolution/30906018

Problem :

My solution’s giving a runtime error, not able to figure out why.

Hey the problem is in line 15 here you are not checking whether the second number is of length greater than or equal to 2 and accessing the 1st index. This would give list index out of bound for this input case:
1
23 1

Thanks for the reply, I did fix that but the error still persisted.

Can you provide the link to your code, which you fixed.

input
1
24 9

output :NZEC (runtime error)
list index out of range

Here it is :

https://www.codechef.com/viewsolution/30912777

Hey your current code fails in the case when both the numbers are of one digit, you should check the condition which you have checked in line 25 before everything else. Your code fails on this tc
1
1 5
Hope this helps.