problem

824. Goat Latin

solution

class Solution {
public:
string toGoatLatin(string S) {
unordered_set<char> vowel{ 'a', 'e', 'i', 'o', 'u',
'A', 'E', 'I', 'O', 'U' };//
istringstream iss(S);//
string res, word;
int cnt = ;
while(iss >> word)
{
res += ' ' + (vowel.count(word[]) ? word : word.substr()+word[]) + "ma" + string(cnt, 'a');//err...
cnt++;
}
return res.substr();//err....
}
};

参考

1. Leetcode_easy_824. Goat Latin;

2. grandyang;

3. discuss;

【Leetcode_easy】824. Goat Latin的更多相关文章

  1. 【LeetCode】824. Goat Latin 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 日期 题目地址:https://leetcode.c ...

  2. 824. Goat Latin - LeetCode

    Questioin 824. Goat Latin Solution 题目大意:根据要求翻译句子 思路:转换成单词数组,遍历数组,根据要求转换单词 Java实现: 用Java8的流实现,效率太低 pu ...

  3. LeetCode 824 Goat Latin 解题报告

    题目要求 A sentence S is given, composed of words separated by spaces. Each word consists of lowercase a ...

  4. [LeetCode&Python] Problem 824. Goat Latin

    A sentence S is given, composed of words separated by spaces. Each word consists of lowercase and up ...

  5. 824. Goat Latin山羊拉丁文

    [抄题]: A sentence S is given, composed of words separated by spaces. Each word consists of lowercase ...

  6. [LeetCode] 824. Goat Latin

    Description A sentence S is given, composed of words separated by spaces. Each word consists of lowe ...

  7. 824. Goat Latin

    class Solution { public: string toGoatLatin(string S) { S.push_back(' '); //add a space that the loo ...

  8. LeetCode 824. Goat Latin (山羊拉丁文)

    题目标签:String 首先把vowel letters 保存入 HashSet. 然后把S 拆分成 各个 word,遍历每一个 word: 当 word 第一个 字母不是 vowel 的时候,把第一 ...

  9. 【Leetcode_easy】1021. Remove Outermost Parentheses

    problem 1021. Remove Outermost Parentheses 参考 1. Leetcode_easy_1021. Remove Outermost Parentheses; 完

随机推荐

  1. Win10开启FTP与配置——(亲测完整无错版)

    #1.控制面板>程序>启用或关闭Windows功能>…(控制面板可在 桌面右键>个性化>主题>桌面图标设置>勾选控制面板>确定) #2.小娜搜索IIS打 ...

  2. 【MySQL】explicit_defaults_for_timestamp 参数详解

    简介:explicit_defaults_for_timestamp 系统变量决定MySQL服务端对timestamp列中的默认值和NULL值的不同处理方法. 此变量自MySQL 5.6.6 版本引入 ...

  3. CSP模拟赛 Matrix(DP)

    题面 求出满足以下条件的 n*m 的 01 矩阵个数: (1)第 i 行第 1~li 列恰好有 1 个 1. (2)第 i 行第 ri~m 列恰好有 1 个 1. (3)每列至多有 1 个 1. n, ...

  4. 怎能使用echo 输出对象

     class A{         function __toString() {             return "怎么使用echo输出对象";          }   ...

  5. 【IOI2019】2048矩形模拟

    /* dos windows 25*80 */ #include <algorithm> #include <windows.h> #include <iostream& ...

  6. QoS in RoCE (zz)

    QoS in RoCE 首页分类标签留言关于订阅2018-03-22 | 分类 Network  | 标签 RDMA  RoCE  ECN  PFC Overview TCP/IP协议栈满足不了现代I ...

  7. GitHub的SSH免密连接

    1.进入当前用户的家目录 $ cd ~ 2.删除.ssh 目录 $ rm -rvf .ssh 3.运行命令生成.ssh 密钥目录 $ ssh-keygen -t rsa -C [GitHub邮箱] [ ...

  8. Integer面试连环炮以及源码分析(转)

    场景:   昨天有位朋友去面试,我问他面试问了哪些问题,其中问了Integer相关的问题,以下就是面试官问的问题,还有一些是我对此做了扩展. 问:两个new Integer 128相等吗? 答:不.因 ...

  9. clickhouse redash---olap

    curl -XPUT '10.1.193.250:9200/ngx-logstash-2019-06/_settings' -d ' { "index.mapping.total_field ...

  10. O缺缺缺缺氧 O缺缺氧

    2019 1.18 优雅的退出/关闭/重启gunicorn进程 Ubuntu查看端口占用情况 微信小程序解决 加载图片出现渲染层网络层错误 更改Ubuntu默认python版本的方法 JS/HTML格 ...