Min-max normalization

Write codeEasy15 min

Your task

Min-max normalize a non-empty list of numbers to the range [0, 1]: each value becomes (x - min) / (max - min). If all values are equal (max == min), the denominator is zero, in that case return a list of all 0.0 of the same length. Round each output to 6 decimal places.

Examples

min_max_normalize(xs: list[float]) -> list[float]
Example 1
Inputmin_max_normalize([0, 5, 10])
Output[0, 0.5, 1]