def is_anagram_hashmap(s, t):
    """
    Determine whether or not teo given strings are anagram by counting
    characters

    Time Complexity: O(n)

    :param s: source string
    :type s: str
    :param t: target string
    :type t: str
    :return: whether or not teo given strings are anagram
    :rtype: bool
    """
    # basic case
    if len(s) != len(t):
        return False

    # construct counter
    counter = [0 for _ in range(256)]
    for i in range(len(s)):
        counter[ord(s[i])] += 1
        counter[ord(t[i])] -= 1

    # cost more time (maybe ord())
    # if len(s) >= 256:
    #     for i in range(len(counter)):
    #         if counter[i] != 0:
    #             return False
    # else:
    #     for i in range(len(s)):
    #         if counter[ord(s[i])] != 0:
    #             return False

    # compare counter
    for i in range(len(counter)):
        if counter[i] != 0:
            return False

    return True