you are given to array containing integers a and b .array is of length n and array b is of length m You need to matches element in a with unique element in b there might be some elements in b that are not matched, but all the elements in a should be matched. so for a configuration the answer is sigma (abs(x-y)) for all the prirs (x,y) where x belongs to a and y belongs to b.
Total absolute difference between pair
At that time i stuck somewhere but now i made the code and its working fine
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.