The suggested input in the problem gets me the correct output but for some reason i get WA in both subtasks.If someone could maybe give me a hint to help me understand where the problem is i would highly appreciate it!! Here is my code for the problem:CodeChef: Practical coding for everyone
In line no 10 you are setting the upper limit of t as 10^5 which is 15 (xor operator)
instead, it should be 10**5.
There's no need to check for condition on t though if it is given that 1<=t<=10**5
then t will always satisfy that condition.
Also, you are doing so many unnecessary things see below code -
for _ in range(int(input())):
s = input()
print(s.count('4'))
1 Like
Thank you,it’s true that i could have simplified it
1 Like