异或 找不同 —。—

 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. Java连接MQTT服务-ws方式

    特别提示:本人博客部分有参考网络其他博客,但均是本人亲手编写过并验证通过.如发现博客有错误,请及时提出以免误导其他人,谢谢!欢迎转载,但记得标明文章出处:http://www.cnblogs.com/ ...

  2. 套接字之select系统调用

    select是IO多路复用的一种方式,用来等待一个列表中的多个描述符的可读可写状态: SYSCALL_DEFINE5(select, int, n, fd_set __user *, inp, fd_ ...

  3. Tomcat权威指南(第二版)下载pdf 高清完整中文版-百度云下载

    本书是一本万能工具,其主题涵盖了Apache Tomcat这一广受欢迎的开源servlet.JSP容器和高性能的web server. <Tomcat权威指南>对管理员和web站点管理员而 ...

  4. Ruby的异常处理

    Ruby在处理0.1+0.2是会出现精度问题: 许多语言都有类似问题,详见网址:http://0.30000000000000004.com/ Ruby的异常处理 如果异常处理范围是整个方法体,可以省 ...

  5. [论文理解] Receptive Field Block Net for Accurate and Fast Object Detection

    Receptive Field Block Net for Accurate and Fast Object Detection 简介 本文在SSD基础上提出了RFB Module,利用神经科学的先验 ...

  6. Web自动化测试—— Selenium+Python Windows环境搭建

    环境搭建前的准备: 1.到Python官网下载Python安装包:https://www.python.org/ 如果不能访问,可以试试下面的解决办法: a).安装VPN网络连接工具,推荐用Green ...

  7. Python学习之==>Socket网络编程

    一.计算机网络 多台独立的计算机通过网络通信设备连接起来的网络.实现资源共享和数据传递.在同一台电脑上可以将D盘上的一个文件传到C盘,但如果想从一台电脑传一个文件到另外一台电脑上就要通过计算机网络 二 ...

  8. :成功配置 centos + nginx + .net core 2.0

    https://segmentfault.com/a/1190000010763523

  9. shadow使用方法

    cd shadow/resource/examples for d in shadow.data/host/*client*: do grep "transfer-complete" ...

  10. php连接mysql,数据CRUD操作

    插入数据 <?php $name = $_GET['username']; $sex = $_GET['sex']; $hobby = $_GET['hobby']; $address = $_ ...