Infosys interview question

Longest common subsequence , count Inversion