# Review my solution to Problem: LADDU Contest: LRNDSA01

Code:
import re
T = int(input())
for x in range(T):
activity = []
activities, origin = map(str, input().split())

``````for i in range(int(activities)):
score = 0
activity.append(input())

for item in activity:
pattern = re.compile("CONTEST_WON[ \s]\d{1,9}")
if pattern.match(item):
_, rank = item.split()
if int(rank)<=5000 and int(rank)<20:
score += 300 + 20 - int(rank)
elif int(rank)<=5000:
score += 300
elif item == "TOP_CONTRIBUTOR":
score += 300
elif item == "CONTEST_HOSTED":
score += 50
else:
_, severity = item.split()

score += int(severity)
``````

if origin == â€śINDIANâ€ť:
print(score//200)
else:
print(score//400)

i checked your code itâ€™s correct
https://www.codechef.com/viewsolution/34875949

I submitted your code and it got accepted the link i have given is your code only.

this link also says '"access denied " use other ide to send the code iâ€¦e;geeks for geeks or other ide.

That is weird â€¦

the last if else block is outside for loop so make it inside for loop and it will be accepted

Oh! Right. I was always testing for 1 test case. Thank you so much @hackraj

1 Like

happy coding