<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def add_elements(arr, k):
    """ Given a non-empty array of integers arr and an integer k, return the sum of the elements with at most two digits from the first k elements of arr. 1. 1 <= len(arr) <= 100 2. 1 <= k <= len(arr) """
    return sum(elem for elem in arr[:k] if len(str(elem)) <= 2)
