leetcode389. Find the Difference
来源:互联网 发布:淘宝代充为什么便宜 编辑:程序博客网 时间:2024/05/18 04:38
求出这两个串中一个不同的值。
开始想用multiset,后来想到string里也有find。
返回的索引值。所以用stringfind很好解决。
class Solution {public: char findTheDifference(string s, string t) { int n=s.size(); int n2=n+1; for(int i=0;i<n;i++){ int in=t.find(s[i]); t[in]='+'; } for(int i=0;i<n+1;i++){ if(t[i]!='+'){ return t[i]; } } }};
阅读全文
0 0
- LeetCode389. Find the Difference
- leetcode389: Find the Difference,
- Leetcode389. Find the Difference
- leetcode389. Find the Difference
- leetcode389. Find the Difference
- LeetCode389. Find the Difference简单
- leetcode389 Find the Difference java
- python--leetcode389. Find the Difference
- leetcode389[easy]---Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- 389. Find the Difference
- Find the Difference
- 160.Find the Difference
- Find the Difference
- 389. Find the Difference
- Leetcode:Find the Difference
- English words page eight
- android 生成开发版SHA1和发布版SHA1
- NGUI减少Drawcall
- 扫雷.c
- 编写Shell脚本的最佳实践
- leetcode389. Find the Difference
- 富途入金步骤记录(个人使用)
- Servlet配置文件
- Recyclerviewdemo
- java类与对象练习题2--图形面积计算
- 求1+2+3+.....+n 不使用xxxxxxxx ( Java 最简单版)
- 网络框架
- Eclipse搭建SSH(Struts2+Spring3+Hibernate3)框架项目教程
- 也许,这样理解HTTPS更容易