Welcome to LeetCode Discuss.  Please read the FAQ to help yourself making the best use of Discuss.
Ask a Question
Back to Problem

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.

#include <bitset> failed

0 votes
49 views

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);

asked 2 days ago in Two Sum by wlxwolves (120 points)

1 Answer

+1 vote

#include <unordered_map> is what you want

try std::unordered_map<int, int>

answered 2 days ago by porker2008 (1,810 points)

...