# Lab 6, part 3

from typing import List

def nested_lengths(L: List[List[str]]) -> List[int]:
    """Return a list where each element is the length of the inner list at the 
    corresponding position of L.
    
    >>> nested_lengths([['1', '2'], ['a', 'b', 'c']])
    [2, 3]
    >>> nested_lengths([['a'], []])
    [1, 0]
    >>> <add your own example here>
    
    """
    # Add code here


def digital_sum(nums_list: List[str]) -> int:
    """Return the sum of all the digits in all strings in nums_list.
    
    Hint: use nested for loops.
    
    Precondition: s.isdigit() holds for each string s in nums_list.

    >>> digital_sum(['64', '128', '256'])
    34
    >>> digital_sum(['12', '3'])
    <insert example result here>
    >>> <add your own example here>
    
    """
    # Add code here
    
    

def print_many(char: str, n: int) -> int:
    """Output char the same number of times as its line number for n lines.
    (remember to print, not return)
    
    Hint: use nested for loops.
    
    >>> print_many('a', 3)
    a
    aa
    aaa
    >>> print_many('!', 5)
    !
    !!
    !!!
    !!!!
    !!!!!
    """
    # Add code here 

    
def can_pay_with_two_coins(denoms: List[int], amount: int) -> bool:
    """Return True if and only if it is possible to form amount, which is a 
    number of cents, using exactly two coins, which can be of any of the 
    denominatins in denoms.
    
    You can repeat coins (e.g., use two 10 cent coins to make 20).
    
    >>> can_pay_with_two_coins([1, 5, 10, 25], 35)
    True
    >>> can_pay_with_two_coins([1, 5, 10, 25], 20)
    True
    >>> can_pay_with_two_coins([1, 5, 10, 25], 12)
    <insert example result here>
    >>> <add your own example here>
    <insert example result here>
    """
    # Add code here   
    
 
def stretch_string(s: str, stretch_factors: List[int]) -> str:
    """Return a string consisting of the characters in s in the same order as 
    in s, repeated the number of times indicated by the item at the 
    corresponding position of stretch_factors.
    
    Hint: you don't need nested for loops.
    
    Precondition: len(s) == len(stretch_factors) and the items of
                  stretch_factors are non-negative
    
    >>> stretch_string('Hello', [2, 0, 3, 1, 1])
    'HHllllo'
    >>> stretch_string('echo', [0, 1, 0, 5])
    <insert example result here>
    """
    # Add code here 



def greatest_difference(nums1: List[int], nums2: List[int]) -> int:
    """Return the greatest absolute difference between numbers at corresponding
    positions in nums1 and nums2.
    
    Hint: you don't need nested for loops.
    
    Precondition: len(nums1) == len(nums2) and nums1 != []
    
    >>> greatest_difference([1, 2, 3], [6, 8, 10])
    7
    >>> greatest_difference([1, -2, 3], [-6, 8, 10])
    <insert example result here>
    """   
    # Add code here
    
    