【LeetCode】Count and Say
来源:互联网 发布:vscode新建c工程 编辑:程序博客网 时间:2024/06/07 05:00
string convert(string str){ stringstream ss; int i,count=0; char last=str[0]; for(i=0;i<=str.size();i++) { if(str[i]==last) { count++; } else { ss<<count<<last; count=1; last=str[i]; } } return ss.str();} string countAndSay(int n) { string output; output="1"; for(int i=1;i<n;i++) { output=convert(output); } return output; }
0 0
- LeetCode: Count and Say
- [LeetCode]Count and Say
- LeetCode Count and Say
- [Leetcode] Count and Say
- Leetcode: Count and Say
- [LeetCode] Count and Say
- LeetCode Count and Say
- [LeetCode]Count and Say
- [LeetCode] Count and Say
- LeetCode-Count and Say
- LeetCode: Count and Say
- LeetCode - Count and Say
- [LeetCode] Count and Say
- Count and Say 【leetcode】
- [LeetCode] Count and Say
- Leetcode Count and Say
- LeetCode Count and Say
- LeetCode | Count and Say
- EBS功能在线帮助文档系统
- MongoDB的$where查询
- R语言 tm包的使用
- QTcpServer如何监听两个不同的端口
- 并发队列ConcurrentLinkedQueue和阻塞队列LinkedBlockingQueue用法
- 【LeetCode】Count and Say
- 缓存--cache
- HTK下实现数字的语音识别(1)链接
- 汽车VIN码校验算法 java版
- django 数据库查询
- firstblood
- 第五章 树和二叉树
- 九度OJ 1207 质因数的个数 (筛素数,勉强AC)
- objective-c post验证付款信息