leetcode之389. Find the Difference(C++解法)
2016-09-11 20:40
639 查看
原题:
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:
e
Explanation:
‘e’ is the letter that was added.
[b]**********************************[/b]我是分割线[b]*******************************[/b]
class Solution {
public:
char findTheDifference(string s, string t) {
int couns[26]={0};
int counts[26]={0};
char resu;
for(int i=0; i
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:
e
Explanation:
‘e’ is the letter that was added.
[b]**********************************[/b]我是分割线[b]*******************************[/b]
class Solution {
public:
char findTheDifference(string s, string t) {
int couns[26]={0};
int counts[26]={0};
char resu;
for(int i=0; i
相关文章推荐
- LeetCode - 389. Find the Difference - 三种不同解法 - ( C++ ) - 解题报告
- leetcode 389 Find the Difference C++
- 【LeetCode-389】Find the Difference(C++)
- LeetCode 389. Find the Difference 题解(C++)
- 389. Find the Difference的C++解法
- 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
- LeetCode389. Find the Difference简单
- LeetCode 389 Find the Difference
- [leetcode]389. Find the Difference -- JavaScript 代码
- leetcode_389 Find the Difference
- LeetCode 389: Find the Difference 题解
- LeetCode : 389. Find the Difference
- LeetCode389. Find the Difference
- leetcode 389. Find the Difference 牛人用异或 或者 求和 解决,很简单。
- leetcode 389. Find the Difference
- Leetcode 389. Find the Difference (Easy) (cpp)