easy solution
Intuitionfollow the directionsApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->
follow the directions

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python3 []
class Solution:
    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:
        negativeonec = 0
        seen = deque()
        res = []
        for n in nums:
           #print(n, seen)
            if n >= 0:
                negativeonec = 0
                seen.appendleft(n)
                continue
            elif n == -1:
                negativeonec += 1
                k = negativeonec
                print(seen, k, n)
                if k <= len(seen):
                    res.append(seen[k - 1])
                else:
                    res.append(-1)
                
        return res

            
```
['Python3']