human
&nbsp;
&nbsp;

1.2 Check Permutation: Given two strings,write a method to decide if one is a permutation of the
other."
Please write code following the instructions in jupyter notebook style.
 Write me a code to &nbsp; and the other steps required?
assistant
#Here is code to &nbsp; and the other steps required.

# def isPermutations(s1,s2):
#     len1 = len(s1)
#     len2 = len(s2)
    
#     if len1 != len2:
#         return False
    
#     ss1=sorted(s1)
#     ss2=sorted(s2)
    
#     for i in range(0,len1):
#         if ss1[i] != ss2[i]:
#             return False
#     return True

def isPermutations(s1,s2):
    if len(s1) != len(s2):
        return False

    char_counts={}

    
    # fill it    
    for c in s1:
        char_counts[c] = char_counts.get(c,0) +1

    # empty it
    for c in s2:
        char_counts[c] = char_counts.get(c,0) -1

    # check if all are 0
    for c in char_counts:
        if char_counts[c] != 0:
            return False

    return True



        
print( isPermutations('abcdefffgh', 'dcabefghff') )