NumPy allowed · plain Python earns 10 bonus points
Identify the optimal threshold for splitting a continuous feature by maximizing Gini impurity reduction.
Implement best_binary_split(X_col, y): evaluate midpoints between consecutive sorted unique feature values. Find the threshold yielding maximum Gini gain, returning (best_threshold, best_gain).
best_binary_split(X_col: list[float], y: list[int]) -> tuple[float, float]