Compute the F1 score, the harmonic mean of precision and recall.
Implement solve(precision, recall).
Returns. Return a float in [0,1]. If precision and recall are both 0 return 0.0.
Example 1
Input:
solve(0.5, 0.5)
Output:
0.5
Example 2
Input:
solve(1.0, 0.25)
Output:
0.4
Example 3
Input:
solve(0.0, 0.0)
Output:
0.0
No results yet
Run your code to check it against the examples, or submit to run every test.