def find_representative(quotient_element: object, valid_range: list) ->int:
    """
    Finds the representative element of `quotient_element` within `valid_range`.

    Parameters:
        quotient_element (QuotientElement): Element to search for.
        valid_range                 (list): Range to search in.
    
    Returns:
        int: Representative element.
    
    Examples:
        >>> from samson.math.all import *
        >>> find_representative((ZZ/ZZ(11))(3), range(11, 22))
        14

    """
    remainder = int(quotient_element)
    modulus = int(quotient_element.ring.quotient)
    if len(valid_range) > modulus:
        raise ValueError('Solution not unique')
    q, r = divmod(valid_range[0], modulus)
    shifted_range = range(r, r + len(valid_range))
    if remainder in shifted_range:
        return q * modulus + remainder
    elif remainder + modulus in shifted_range:
        return (q + 1) * modulus + remainder
    else:
        raise ValueError('No solution')
