You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I try to Run/Submit solution (as below) in C++ issue occurs. For simple Run, only bottom Console Output comes out but it is totally empty (screenshot 1).
For Submit, I receive 'Unknown' response in Submissions tab (screenshot 2).
On leetcode website, the same exact code works and passes all the tests. I am attaching code and leetcode pass prove (screenshot 3)
Screenshot 1:
Screenshot 2:
Screenshot 3:
Code:
class Solution {
public:
bool containsNearbyDuplicate(vector<int>& nums, int k) {
int L = 0;
unordered_set<int> window;
for (int R = 0; R < nums.size(); R++) {
if (window.count(nums[R])) {
return true;
}
window.insert(nums[R]);
if (window.size() > k) {
window.erase(nums[L]);
L++;
}
}
return false;
}
};
The text was updated successfully, but these errors were encountered:
Bug Report for https://neetcode.io/problems/contains-duplicate-ii
When I try to Run/Submit solution (as below) in C++ issue occurs. For simple Run, only bottom Console Output comes out but it is totally empty (screenshot 1).
For Submit, I receive 'Unknown' response in Submissions tab (screenshot 2).
On leetcode website, the same exact code works and passes all the tests. I am attaching code and leetcode pass prove (screenshot 3)
Screenshot 1:
Screenshot 2:
Screenshot 3:
Code:
The text was updated successfully, but these errors were encountered: