LeetCode 389. Find the Difference
2016-11-03 17:04
288 查看
public class Solution { public char findTheDifference(String s, String t) { char[] sToChars = s.toCharArray(); char[] tToChars = t.toCharArray(); char r = '\0'; for (int i = 0; i < sToChars.length; i++) r = (char)(r ^ sToChars[i]); for (int i = 0; i < tToChars.length; i++) r = (char)(r ^ tToChars[i]); return r; } }
相关文章推荐
- 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
- leetcode 389. Find the Difference 牛人用异或 或者 求和 解决,很简单。
- LeetCode 389:Find the Difference
- Leetcode 389 Find the Difference
- Leetcode 389. Find the Difference
- leetcode:bits:Find the Difference(389)
- [leetcode] 389. Find the Difference 解题报告
- 【leetcode】389. Find the Difference【E】
- 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 C++
- 【leetcode】389. Find the Difference
- leetcode之389. Find the Difference(C++解法)