异或 找不同 —。—

 public class Solution {
public char findTheDifference(String s, String t) {
char temp = 0x00;
for(int i = 0;i < s.length();i++){
temp =(char) (temp ^ s.charAt(i));
}
for(int i = 0;i < t.length();i++){
temp =(char) (temp ^ t.charAt(i));
}
return temp;
}
}

【leetcode389】389. Find the Difference的更多相关文章

  1. 【LeetCode】389 Find the Difference(java)

    原题 Given two strings s and t which consist of only lowercase letters. String t is generated by rando ...

  2. 【LeetCode】389. Find the Difference 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 方法一:字典统计次数 方法二:异或 方法三:排序 日 ...

  3. 【PPT】 Least squares temporal difference learning

    最小二次方时序差分学习 原文地址: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd= ...

  4. 【leetcode_easy】530. Minimum Absolute Difference in BST

    problem 530. Minimum Absolute Difference in BST 参考 1. Leetcode_easy_530. Minimum Absolute Difference ...

  5. 【leetcode】1200. Minimum Absolute Difference

    题目如下: Given an array of distinct integers arr, find all pairs of elements with the minimum absolute ...

  6. 【LeetCode】389.找不同

    389.找不同 知识点:哈希表.抵消思想: 题目描述 给定两个字符串 s 和 t,它们只包含小写字母. 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母. 请找出在 t 中被添加的字母. ...

  7. 【LeetCode】1200. Minimum Absolute Difference 解题报告 (C++)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 排序 日期 题目地址:https://leetcode ...

  8. 【LeetCode】530. Minimum Absolute Difference in BST 解题报告(Java & Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 Python解法 日期 题目地址:ht ...

  9. 【LeetCode】539. Minimum Time Difference 解题报告(Python)

    作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.me/ 题目地址:https://leetcode.com/problems/minimum-t ...

随机推荐

  1. Spring MVC三种返回方式

    spring mvc处理方法支持如下的返回方式:ModelAndView, Model, ModelMap, Map,View, String, void. 下面一一进行说明: 1.ModelAndV ...

  2. Python学习之==>循环

    1.While循环 # 循环的时候是在重复执行循环体里面的东西 # 在循环体里面遇到break,立即结束循环,不管循环有没有完 # 在循环体里面遇到continue,那么就结束本次循环,继续进行下一次 ...

  3. 百度地图POI爬取

    我们研究生的课程内容,做下笔记记录一下. 使用的python环境是python3.7 用的图大部分都是老师ppt里的图,懒得自己截了-- 申请百度开发者密匙 (1)注册百度用户,注册过的话,直接登录就 ...

  4. linux环境下安装yaf

    一.ubuntu环境 1.首先到http://pecl.php.net/get/yaf下载最新版本的yaf,我的是yaf-2.2.9.tgz. 2.解压 tar -zxvf yaf-2.2.9.tgz ...

  5. body标签中的相关标签

    一.内容概要 字体标签 h1~h6 <font> <u> <b> <strong> <em> <sup> <sub> ...

  6. 【VS开发】【智能语音处理】语音信号处理之(一)动态时间规整(DTW)

    语音信号处理之(一)动态时间规整(DTW) zouxy09@qq.com http://blog.csdn.net/zouxy09 这学期有<语音信号处理>这门课,快考试了,所以也要了解了 ...

  7. 关于ElementUI中日期选择器时间选择范围限制

    1.组件代码 <el-date-picker v-model="value1" type="date" placeholder="选择日期&qu ...

  8. js多张图片合成一张图,canvas(海报图,将二维码和背景图合并) -----vue

    思路:vue中图片合并 首先准备好要合并的背景图,和请求后得到的二维码, canvas画图,将两张背景图和一张二维码用canvas画出来, 将canvas再转为img 注意canvas和图片的清晰图和 ...

  9. mysql——多表——合并查询结果

    合并查询结果 合并查询结果 是将多个select语句的查询结果合并到一起 union关键字,数据库会将所有的查询结果合并到一起,然后除掉相同的记录: union all关键字,只是简单的合并到一起 前 ...

  10. form 校验

    import refrom django.forms import Formfrom django.forms import widgetsfrom django.forms import field ...