One pass. Very elegant;) 80% speed
Code
# Code
```python3 []
class Solution:
    def solveQueries(self, nums: List[int], queries: List[int]) -> List[int]:
        len_nums = len(nums)
        diff_nums = [inf] * len_nums
        nums_idx = defaultdict(int)

        for double_idx in range(2 * len_nums):
            i = double_idx % len_nums
            n = nums[i]
            if n in nums_idx:
                j = nums_idx[n] # previous index
                if i != j:
                    current_diff = double_idx - j
                    diff_nums[j] = min(diff_nums[j], current_diff)
                    diff_nums[i] = min(diff_nums[i], current_diff)
            nums_idx[n] = i

        return [diff_nums[q] if diff_nums[q] < inf else -1 for q in queries]
```
['Python3']