FunctionRacerProblemsRace

Rank Agreement

EasySciPyPython

Two judges scored the same contestants: a[i] and b[i] are their scores for contestant i. Return the Spearman rank correlation of the two lists: 1 when they order the contestants the same way, -1 when exactly opposite.

Example 1

a [1,2,3]
b [10,20,90]
returns 1.0

Both lists put the contestants in the same order, even though the scores are far apart.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More SciPy problems