def length_of_elements(elementList, index=0, lengths=None):
    """
    Returns the length of each row (sub-array) in a single array
    """
    if lengths is None:
        lengths = []
    # Will only calculate len if index is lower than the len of the array.
    # If it isn't less, will return the final array of lengths.
    if index < len(elementList):

        # Appends the length of the current element using the
        # "index" param, which starts as 0.
        lengths.append(len(elementList[index]))

        # For each time it appends a length, calls again the function, sending
        # the listOfElements, the lengths array with the previous value\s and the
        # index plus 1, last one so looks for the next element
        length_of_elements(elementList, index + 1, lengths)

    return lengths