def accuracy(letters, target_string):
    """ Comparing accuracy to the correct answer.

    Args:
        letters(np.array): (num_chars, )
        target_string(str)

    Return:
        float: accuracy.
    """
    count = 0
    assert len(letters) == len(target_string)
    for i in range(len(target_string)):
        if letters[i] == target_string[i]:
            count += 1
    return count / len(target_string)