def solve(want, func, stop):
    """Returns values of x for which func(x) == want
    for x in the range 0..(stop-1)"""
    solutions = list()
    for x in range(stop):
        if func(x) == want:
            solutions.append(x)
    return solutions