✅ 🎯 📌 Simple Solution || Pointers || Fastest Solution ✅ 🎯 📌
Code\npython3 []\nclass Solution:\n    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:\n        s=[]\n        curr=0\n        ans=[]\n        for i
# Code\n```python3 []\nclass Solution:\n    def lastVisitedIntegers(self, nums: List[int]) -> List[int]:\n        s=[]\n        curr=0\n        ans=[]\n        for i in range(len(nums)):\n            if nums[i]!=-1: \n                curr=0\n                s.append(nums[i])\n            else:\n                if len(s)-1-curr<0:\n                    ans.append(-1)\n                else: ans.append(s[len(s)-1-curr])\n                curr+=1\n        return ans\n```
['Array', 'Simulation', 'Python3']