Welcome to LeetCode Discuss.
This is a place to ask questions related to only OJ problems.
Please read the FAQ to help yourself making the best use of Discuss.
I want to use bitset in C++. So the time complexity is O(n). However, I failed to include. The compile error is "Line 7: 'bitset' was not declared in this scope".
So, are there any other way to solve this problem and the complexity is O(n);
#include <unordered_map> is what you want
#include <unordered_map>
try std::unordered_map<int, int>
std::unordered_map<int, int>