异或 找不同 —。—

 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. 2018-2019-2 20175215 实验一《Java开发环境的熟悉》实验报告

    一.实验内容及步骤 1.使用JDK编译.运行简单的Java程序 cd code进入code文件夹 mkdir 20175215exp1创建20175215exp1文件夹 ls查看当前目录 cd 201 ...

  2. 第八周学习总结&实验报告(6)

    实验六 异常 一.实验目的: (1)理解异常的基本概念: (2)掌握异常处理方法及熟悉常见异常的捕获方法. 二.实验要求: (1)练习捕获异常.声明异常.抛出异常的方法.熟悉try和catch子句的使 ...

  3. 菜鸟requireJS教程---1、初识requirejs

    菜鸟requireJS教程---1.初识requirejs 一.总结 一句话总结: Using a modular script loader like RequireJS will improve ...

  4. 解决:linux eclipse 对‘dlopen’未定义的引用, 对‘xxx’未定义的引用

    如果是终端窗口执行的话直接: 在g++编译选项后面,加入dl的库,选项为-ldl,即可. 如果是在eclipse里的话: 在工程属性中->c/c++ build->gcc complier ...

  5. eclipse subclipse svn 插件安装使用

    一.在线安装 1.打开Eclipse,菜单栏中选择"Help"->"Install New SoftWare..." 2.在弹出的对话框中,点击" ...

  6. python接口测试之mock(三)

    前面介绍了moco的详细的使用,它主要是基于moco-runner-0.11.0-standalone.jar,通过编写json的文件来实现,mock翻译过来就是模拟的意思,也就是说,它是将测试对象所 ...

  7. http协议详解1

    一.http协议url组成部分详解:1.协议类型2.ip(服务器地址)3.port(或域名)4.path(请求资源所在地址)5.?(资源地址与参数的分割符合)6.参数(请求参数)7.&(多个参 ...

  8. shell脚本判断端口是否打开

    [root@www zabbix_scripts]# cat check_httpd.sh #!/bin/bash a=`lsof -i: | wc -l` " ];then " ...

  9. 之前写的页面导出Excel表格

    废话不多说,直接上代码 <%@ page language="java" import="java.util.*" pageEncoding=" ...

  10. EINT DINT ERTM DRTM EALLOW EDIS ESTOP0的理解

    本文参考以下资料整理 https://wenku.baidu.com/view/6b0d6906cf84b9d528ea7a66.html http://pangqicheng123.blog.163 ...