Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .

0 like 0 dislike
1,080 views
in Online Assessments by Expert (144,420 points)

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 (144,420 points)
...