Easy
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```python3 []\nclass Solution:\n    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:\n        seen,ans=[],[]\n        kcount=0\n        for i in nums:\n            if i==-1:\n                kcount+=1\n                if kcount>len(seen):\n                    ans.append(-1)\n                else:\n                    ans.append(seen[kcount-1])\n            else:\n                kcount=0\n                seen.insert(0,i)\n        return ans\n        \n        \n```
['Python3']