We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I had same issue and added this line
if name == 'main':
inputData = []
counter = 0
for line in sys.stdin:
counter += 1
charcount = 0
line.replace(' ','\t',2) #this line
state, city = line.strip().split("\t")
in python 2 and that resolved.
Hope that is helpful
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Map Reduce Tutorials - #2 The Group By Operator
You are viewing a single comment's thread. Return to all comments →
I had same issue and added this line if name == 'main': inputData = [] counter = 0 for line in sys.stdin: counter += 1 charcount = 0 line.replace(' ','\t',2) #this line state, city = line.strip().split("\t")
in python 2 and that resolved. Hope that is helpful