I didn’t understood the question clearly. 4 -5 100 1000 1005 3 -12 1000 1001 In this sample shouldn’t the answer be 2104 by adding elements of first sequence only.
Also what to do if no intersecting numbers are present in both sequence?
NO!
Of course, YES!, yes,! yes!
If you don’t find the answer for that question by yourself, you shouldn’t beginning this problem.
BTW Very similar method you can use in problem ABCDEF.
Ohh actually this 4 and 3 in 4 -5 100 1000 1005, 3 -12 1000 1001 was number of elements.BTW i did it by using binary search and comparison of values using pair of vector. Thx