class Solution {
public:
vector<string>mys;
vector<string> letterCasePermutation(string S) {
dfs(S,0);
return mys;
}
void dfs(string S,int n)
{
if(n==S.size())
{
mys.push_back(S);
return;
}
dfs(S,n+1);回溯 点(不变)
if(S[n]>=65)
{
S[n]^=32;
dfs(S,n+1);(变)
}
}
};
leetcode 784. 字母大小写全排列(c++位运算)
最新推荐文章于 2023-01-01 14:29:33 发布