leetcode First Unique Character in a String
来源:互联网 发布:梦幻西游手游秒抢软件 编辑:程序博客网 时间:2024/05/16 18:07
class Solution {public: int firstUniqChar(string s) { map<char,int> chars; for(int i=0; i< s.size(); i++) { int temp = chars[s[i]]; if(temp !=0) { chars[s[i]]=2; } else { chars[s[i]]=1; } } for(int i=0; i< s.size(); i++) { int temp = chars[s[i]]; if(temp ==1) { return i; } } return -1; }};
0 0
- [Leetcode]First Unique Character in a String
- LeetCode: First Unique Character in a String
- LeetCode-First Unique Character in a String
- leetcode---First Unique Character in a String
- leetcode:First Unique Character in a String
- LeetCode-First Unique Character in a String
- [Leetcode] First Unique Character in a String
- leetcode First Unique Character in a String
- Leetcode First Unique Character in a String
- LEETCODE--First Unique Character in a String
- LeetCode -- First Unique Character in a String
- LeetCode : First Unique Character in a String
- LeetCode First Unique Character in a String
- LeetCode-----First Unique Character in a String
- LeetCode—387. First Unique Character in a String
- 【leetcode】387. First Unique Character in a String【E】
- LeetCode(387)First Unique Character in a String
- <LeetCode OJ> 387. First Unique Character in a String
- Android studio aar 混淆
- AngularJS基础二
- 新一代IT人才正在路上
- 8、人脸识别经典算法一:特征脸方法(Eigenface)
- Android自定义View之高仿卫星发散控件
- leetcode First Unique Character in a String
- app加载广告
- 图标字体详细制作过程介绍
- shell 控制台运行lua代码
- 将指定文件夹下的文件转换成utf-8的
- 线程协作(生产者与消费者问题)
- 微信支付、退款配置笔记
- js中的类型判断typeof、instanceof、constructor和prototype
- React-Native 与原生的3种交互通信(Android)