Message on Whatsapp 8879355057 for DSA(OA + Interview) + Fullstack Dev Training + 1-1 Personalized Mentoring to get 10+LPA Job
0 like 0 dislike
662 views
in Online Assessments by Expert (113,390 points) | 662 views

1 Answer

0 like 0 dislike

image

 

For each num in the array, I used a dictonary where the values were the indicies. Then basically did a triple for loop optimized with binary search iterating through each of number's lists in the query, however this TLE-ed. Please share if you come up with an optimal solution!

by Expert (113,390 points)