I understand that my solution is not the most efficient one for TRUEDARE problem. But it should work within the given constraints. But it is being evaluated as 'Time Limit Exceeded'. Can someone please point out the issue. Thanks.

c-plus-plus
tle
truedare

#1

https://www.codechef.com/viewsolution/23620718


#2

Your solution will work in O((size11size12)+(size21size22)) value of this will be more than 10^8… So use sorting on all 4 arrays first and reduce complexity… Or use map to reduce complexity