0ms & beats 100% solution
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```javascript []\n/**\n * @param {number[]} nums\n * @return {number[]}\n */\nvar lastVisitedIntegers = function(nums) {\n    let seen = []\n    let ans = []\n    let k = 0\n    for(let i = 0 ;i<nums.length;i++){\n        if(nums[i] > 0){\n            seen.unshift(nums[i])\n            k = 0\n        }\n        if(nums[i]=== -1){\n            k++\n            if(k > seen.length){\n                ans.push(-1)\n            }else{\n                ans.push(seen[k-1])\n            }\n        }\n\n    }\n    \n    return ans\n};\n```
['JavaScript']