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.
In Python, I had to change the source code of the main routine, because it was giving errors. Below is the modified source code, before solving the problem:
#!/bin/python3importmathimportosimportrandomimportreimportsys## Complete the 'similarStrings' function below.## The function is expected to return an INTEGER_ARRAY.# The function accepts following parameters:# 1. INTEGER n# 2. 2D_INTEGER_ARRAY queries#defsimilarStrings(word,queries):# Write your code hereif__name__=='__main__':fptr=open(os.environ['OUTPUT_PATH'],'w')first_multiple_input=input().rstrip().split()n=int(first_multiple_input[0])q=int(first_multiple_input[1])word=input().rstrip().split()[0]queries=[]for_inrange(q):queries.append(list(map(int,input().rstrip().split())))result=similarStrings(word,queries)fptr.write('\n'.join(map(str,result)))fptr.write('\n')fptr.close()
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Similar Strings
You are viewing a single comment's thread. Return to all comments →
In Python, I had to change the source code of the main routine, because it was giving errors. Below is the modified source code, before solving the problem: