Return the majority class among the labels that reach a leaf of a decision tree. If several classes tie for the highest count, return the smallest label.
Implement solve(y).
Returns. Return the winning label (a scalar taken from y).
Example 1
Input:
solve([0, 1, 1, 0, 1])
Output:
1
Example 2
Input:
solve([2, 2, 3, 3])
Output:
2
No results yet
Run your code to check it against the examples, or submit to run every test.