Write a function that computes the discounted return for a given sequence of rewards and discount factor gamma. The state value is the expectation of this return. Here rewards[k] is , the sum runs over the given rewards, and the result is returned as a float. Only use NumPy.