784. Letter Case Permutation

784. Letter Case Permutation
[思路]:
对于一个字母和数字字符串,返回大写和小写的所有可能序列;
那么我们遍历每个字符,遇到字母替换大小写:
我的想法利用队列,遍历每个字符,将每种可能存到队列中,然后一个个替换,生成所有可能的字符串;

    vector letterCasePermutation(string S) {
        deque q;
        vector s;
        string temp;
        if(S.empty()){ //如果为空,返回空字符串
            s.push_back("");
            return s;
        }
        q.push_back(S);//入队列
        for(int i=0;i

你可能感兴趣的:(784. Letter Case Permutation)