is the rank position of person p in ROL L.
What's the total algorithm running time?
Not hard to do better than this (HW).