Easiest Solution Ever
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:\n        seen = []  # This will hold the positive integers\n        ans = []   # This will store the result\n        k = 0      # Number of consecutive -1s\n        \n        for num in nums:\n            if num > 0:\n                seen.insert(0, num)  # Prepend the positive integer to seen\n                k = 0  # Reset the counter for -1s as we have seen a positive integer\n            \n            elif num == -1:\n                k += 1  # Increase the count of consecutive -1s\n                if k <= len(seen):\n                    ans.append(seen[k - 1])  # Get the k-th last visited integer\n                else:\n                    ans.append(-1)  # Not enough integers in seen\n\n        return ans\n```
['Python3']