【leetcode389】389. Find the Difference
异或 找不同 —。—
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的更多相关文章
- 【LeetCode】389 Find the Difference(java)
原题 Given two strings s and t which consist of only lowercase letters. String t is generated by rando ...
- 【LeetCode】389. Find the Difference 解题报告(Java & Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 方法一:字典统计次数 方法二:异或 方法三:排序 日 ...
- 【PPT】 Least squares temporal difference learning
最小二次方时序差分学习 原文地址: https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd= ...
- 【leetcode_easy】530. Minimum Absolute Difference in BST
problem 530. Minimum Absolute Difference in BST 参考 1. Leetcode_easy_530. Minimum Absolute Difference ...
- 【leetcode】1200. Minimum Absolute Difference
题目如下: Given an array of distinct integers arr, find all pairs of elements with the minimum absolute ...
- 【LeetCode】389.找不同
389.找不同 知识点:哈希表.抵消思想: 题目描述 给定两个字符串 s 和 t,它们只包含小写字母. 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母. 请找出在 t 中被添加的字母. ...
- 【LeetCode】1200. Minimum Absolute Difference 解题报告 (C++)
作者: 负雪明烛 id: fuxuemingzhu 个人博客:http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 排序 日期 题目地址:https://leetcode ...
- 【LeetCode】530. Minimum Absolute Difference in BST 解题报告(Java & Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 目录 题目描述 题目大意 解题方法 Java解法 Python解法 日期 题目地址:ht ...
- 【LeetCode】539. Minimum Time Difference 解题报告(Python)
作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.me/ 题目地址:https://leetcode.com/problems/minimum-t ...
随机推荐
- 190707Python-Redis
一.Redis的简单使用 Redis操作模式 # Author:Li Dongfei import redis r = redis.Redis(host='192.168.56.7', port=63 ...
- java.net.BindException: Problem binding to [node2:45454] java.net.BindException: Cannot assign requested address
主要原因是网络的问题.可参考官方给出的详细解释. http://wiki.apache.org/hadoop/BindException 总之,这是网络或者配置网络的问题,跟 hadoop 基本没有关 ...
- golang defer 延后执行什么
对于golang的defer,我们已经知道,defer定义的语句可以延后到函数返回时执行. 经常用在文件的关闭,锁的释放等场景中.而且defer定义的语句即使遇到panic也会执行.这样,可以执行必要 ...
- Zxing二维码的集成使用
在github网站搜索Zxing 详见:https://github.com/yipianfengye/android-zxingLibrary 在module的build.gradle中执行comp ...
- if-else判断语句
<1>if-else的使用格式 if 条件: 满足条件时要做的事情1 满足条件时要做的事情2 满足条件时要做的事情3 ...(省略)... else: 不满足条件时要做的事情1 不满足条件 ...
- 详析静态网站与动态网站区别(服务器ip dns 端口)
几个基本知识 1.服务器:能够提供服务的机器 取决于机器上所安装的服务软件 1) web服务器:提供web服务(网站访问) 就需要安装web服务软件,Apache,tomcat,iis等 2. ...
- Jmeter(一) - 调用数据的参数化
1. 做性能测试, 不可避免的一点一定会有使用不同的用户密码进行登陆. 如何使登陆用户参数化呢?
- web开发(五) JSP详解(四大作用域九大内置对象等)
在网上看见一篇不错的文章,写的详细. 以下内容引用那篇博文.转载于<http://www.cnblogs.com/whgk/p/6427759.html>,在此仅供学习参考之用. 一.JS ...
- jquery 教程网
- HCL试验2
PC端配置:配置ip地址 交换机1配置:①创建VLAN system-view vlan 10 vlan 20 ②配置PC端接口 interface gi 1/0/1 port link-type a ...