I was reading about algorithms to find LCS in O(nlogn) and i came through this research paper — link
It claims to find LCS in O((n+r)logn) where r are the number of matching pairs.
But I can't understand how the final algorithm is O(n+rlogn) , I guess the algorithm is O(n*r*logn) ,please clear my doubt I can't understand?