leetcode389389. Find the Difference

Posted Yaaaaa

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了leetcode389389. Find the Difference相关的知识,希望对你有一定的参考价值。

异或 找不同 —。—

 1 public class Solution {
 2     public char findTheDifference(String s, String t) {
 3         char temp = 0x00;
 4         for(int i = 0;i < s.length();i++){
 5             temp =(char) (temp ^ s.charAt(i));
 6         }
 7         for(int i = 0;i < t.length();i++){
 8             temp =(char) (temp ^ t.charAt(i));
 9         }
10         return temp;
11     }
12 }

 

以上是关于leetcode389389. Find the Difference的主要内容,如果未能解决你的问题,请参考以下文章

#Leetcode# 997. Find the Town Judge

LeetCode: Find the Duplicate Number

LeetCode 997. Find the Town Judge

Leetcode: Find the Difference

LeetCode 389. Find the Difference

Leetcode 389 Find the difference