Simple python solution 100% Time
IntuitionIterate over the nums list and follow instructions on how to populate seen and ansApproachk will serve as the counter and index when encountring -1 to
# Intuition
Iterate over the nums list and follow instructions on how to populate seen and ans

# Approach
k will serve as the counter and index when encountring -1 to populate ans with the matching element from seen

# Complexity
- Time complexity:
O(n)

- Space complexity:
Two additional lists  O(n)

# Code
```python3 []
class Solution:
    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:
        seen = []
        ans = []
        k = 0
        for i in range(0, len(nums)):
            if nums[i] > 0:
                seen.append(nums[i])
                k = 0
            else:
                k +=1
                if k <= len(seen):
                    ans.append(seen[len(seen) - k])
                else:
                    ans.append(-1)
        return ans
```
['Python3']