Hello,
I have written the Python code below which is running perfectly in the IDE.
But it gives Runtime Error on editor of Google Code Jam.
Can anyone please tell me what is the error I am committing?
import math
def find4(objective):
rem=objective
i =0
x=0
y=0
while(rem>0):
val = rem % 10
rem=int(rem/10)
# print(rem)
if(val==4):
x+=int((val-1)*math.pow(10,i))
y+=int(1*math.pow(10,i))
else:
x +=int(val*math.pow(10,i))
#y += val * math.pow(10, i)
i += 1
# if(rem==4):
return x,y
# print(find4(54))
testCases = input()
lim=int(testCases)
while(lim>0):
objective=input()
a,b=find4(int(objective))
lim-=1
# print(a,b)
print(f'Case #{int(testCases)-lim}:',a,b)
Thanks & Regards,
Akshit Bhatia
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-code/ff492fc9-a82e-4907-8b02-e106abcfa425%40googlegroups.com.