国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > C++ > 正文

C++的標準庫的各種容器

2019-11-06 06:31:38
字體:
來源:轉載
供稿:網友

 unordered_set:

class Solution {

public:    vector<string> findWords(vector<string>& words) {        vector<string> res;        unordered_set<char> row1{'q','w','e','r','t','y','u','i','o','p'};        unordered_set<char> row2{'a','s','d','f','g','h','j','k','l'};        unordered_set<char> row3{'z','x','c','v','b','n','m'};        for (string word : words) {            int one = 0, two = 0, three = 0;            for (char c : word) {                if (c < 'a') c += 32;                if (row1.count(c)) one = 1;                if (row2.count(c)) two = 1;                if (row3.count(c)) three = 1;                if (one + two + three > 1) break;            }            if (one + two + three == 1) res.push_back(word);        }        return res;    }

};


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表

圖片精選

主站蜘蛛池模板: 洪湖市| 曲阜市| 英吉沙县| 商城县| 剑阁县| 贵港市| 泗水县| 南溪县| 探索| 平果县| 怀安县| 荣昌县| 松阳县| 北票市| 锡林郭勒盟| 临安市| 文水县| 突泉县| 博乐市| 霞浦县| 锡林郭勒盟| 北京市| 浦东新区| 全南县| 香格里拉县| 于都县| 扬中市| 新晃| 汝城县| 固原市| 陕西省| 灵宝市| 安塞县| 青铜峡市| 喀喇| 天峨县| 大丰市| 成都市| 罗田县| 长宁区| 巨鹿县|