from collections import defaultdict


def problem_1_3(left: str, right: str) -> bool:
    """
    Given two strings, write a method to decide if one is a permutation of the other.

    So, I could iterate through a range of indicies and construct a single hashmap to store the counts of a character.
    We can add from one str and remove from the other. This would result in all values should equal = 0
    >>> problem_1_3("abc", "cba")
    True
    >>> problem_1_3("a", "b")
    False
    >>> problem_1_3("aabbcc", "ccbbaa")
    True

    The below solution using a defaultdict should return with speed of O(n)
    """
    if len(left) != len(right):
        return False


    _d = defaultdict(int)

    for i in range(len(left)):
        _d[left[i]] += 1
        _d[right[i]] -= 1

    for v in _d.values():
        if v != 0:
            return False
    return True