![image](https://assets.leetcode.com/users/images/d85808fd-3fb1-432f-a028-8c26c21f67c2_1617808280.2225785.png)
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!