Similar Strings

Sort by

recency

|

32 Discussions

|

  • + 0 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:

    #!/bin/python3
    
    import math
    import os
    import random
    import re
    import sys
    
    #
    # 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
    #
    
    def similarStrings(word, queries):
        # Write your code here
    
    if __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 _ in range(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()
    
  • + 0 comments

    Here is my solution in java, javascript, python, C, CSharp, C++ HackerRank Similar Strings Problem Solution

  • + 0 comments

    Here is the solution of Similar Strings Click Here

  • + 1 comment

    https://zeroplusfour.com/similar-strings-hackerrank-solution/

    Here's how I did in all languages Java 8 , C++ , C , Python 3, Python 2.

  • + 0 comments

    Seems that template code is missing parse the input string.