LeetCode[389]Find the Difference
来源:互联网 发布:社交网络达人 编辑:程序博客网 时间:2024/06/09 15:50
Given two strings s and t which consist of only lowercase letters.
String t is generated by random shuffling string s and then add one more letter at a random position.
Find the letter that was added in t.
Example:
Input:s = "abcd"t = "abcde"Output:eExplanation:'e' is the letter that was added.
class Solution {public: char findTheDifference(string s, string t) { sort(s.begin(), s.end()); sort(t.begin(), t.end()); int i; for (i = 0; i < s.size(); i++) if (s[i] != t[i]) break; return t[i]; }};
0 0
- LeetCode 389 Find the Difference
- Leetcode 389 Find the Difference
- Leetcode 389 Find the Difference
- LeetCode[389]Find the Difference
- LeetCode 389:Find the Difference
- Leetcode 389 Find the Difference
- [LeetCode-389]Find the Difference
- Leetcode 389 Find the Difference
- leetcode-389-find the difference
- leetcode 389 Find the Difference
- Leetcode #389 Find the Difference
- Leetcode 389 Find the Difference
- LeetCode.389 Find the Difference
- Leetcode:Find the Difference
- Find the Difference --LeetCode
- LeetCode Find the Difference
- [LeetCode] Find the Difference
- [Leetcode] Find the Difference
- 动画 (不停旋转 | 由内向外扩大缩小 透明度渐变)
- 自定义控件三部曲之绘图篇(七)——Paint之函数大汇总
- java 大排序
- NSMutableAttributedString && NSAttributedString
- SQL2008清除日志文件脚本
- LeetCode[389]Find the Difference
- String与StringBuffer的区别
- php7编译安装
- Linux内存管理中内存的组织及主要数据结构分析(pg_data_t&&page&&zone)
- cout输出16进制
- git命令大全
- C#中使用listview的checkBoxs全选和取消全选
- 占位
- javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building f