I am trying out this problem in a coding competition. I believe I have solved the problem, but have some problem in taking the input. Help me out here:
Input
The first line of the input contains a single integer T denoting the number of test cases. The description for T test cases follows. Each test case consists of a single line containing two space-separated strings R and S denoting the two recipes.
Now, I have coded the problem and it seems to work, but whenever I directly copy paste the input values, it fails to work by giving this error message
T= int(raw_input())
ValueError: invalid literal for int() with base 10:
'3\nalex axle\nparadise diapers\nalice bob'
Whenever I try to submit the problem, I get an error message. May be they are also copy pasting the input values and checking for the output. My code skeleton goes something like this
def whetherGranama(str1,str2):
return "NO"
#can't give the implementation out yet
T= int(raw_input())
ans=[]
for x in range(0,T):
s=raw_input()
s1,s2=s.split()
ans.append(whetherGranama(s1,s2))
for elem in ans:
print elem
How can I fix the \n error ? I think the entire input is treated as one string.