class Solution
{
public:
map<char,char> Kuohao=
{
{')','('},
{'}','{'},
{']','['}
};
bool isValid(string s)
{
stack<char> temp;
for(int i=0;i<s.size();i++)
{
// if (Kuohao.get(s[i])!=temp.top())
{
temp.push(s[i]);
}
else
{
temp.pop();
}
}
return temp.empty();
};
};
在双斜杠处报错,想现在map中搜索字符串一个字符对应的value,请问为何出错,如何改正,谢谢。