Video rankings. The InstaVid social network collects user preferences by ask ing them to rank their favorite videos. One of the features of InstaVid is offering friendship suggestions for users with similar tastes, using the following metric If user One ranks the videos using the sequence 1,2,..., n same videos using the sequence ul, U2, . . . , Un of Video rankings. The InstaVid social network collects user preferences by ask ing them to rank their favorite videos. One of the features of InstaVid is offering friendship suggestions for users with similar tastes, using the following metric If user One ranks the videos using the sequence 1,2,..., n same videos using the sequence ul, U2, . . . , Un of numbers 1, 2, . . . , n, then their social distance is computed by counting all pairs (u,リfrom the ranking of Tuo that satisfy the condition vi > vj for i < j. For example, if the user One ranks four videos as 1,2,3, 4 and Two ranks them as 3,1,2,4 then their social distance is 2 because of the pairs (3,1) and (3,2) in the rankings of Two. , and user Tu o ranks (i) Design an algorithm social_distance (prefa, prefb) with time complexity in e(n2) that computes the social distance for users with video rankings prefa and prefb. Please write your solution in the form of a Python function. Justify the run time of your code (ii) Improve your algorithm using divide and conquer approach. Fully analyse your algorithm; you may use the Master Theorem. Write your solution in the form of a Python function. (You may also write pseudocode if desired; we will not run your code anyway, but it is aceptable to actually implement your code in Python and copy it in your soluton.)