def normalize_list(L):
    """Normalize an array of numbers such that each element satisfies:
        0 <= e <= 1
    """
    if not L:
        return L
    max_ = max(L)
    if max_ > 0:
        return [(float(e) / max_) for e in L]
    return L