摘要: 题目链接:https://leetcode.com/problems/valid-anagram/ 题目大意:就是判断两个字符串是否由相同的字符组成(字符个数也要相同) 1)排序方法 将字符串进行排序以后,如果想等,即可 代码如下: 2)hash方法 先统计第一个字符串中各个字符出现的次数,然后再遍 阅读全文
posted @ 2016-06-18 23:30 Shirley_ICT 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://leetcode.com/problems/intersection-of-two-arrays/ 题目大意:要求两个数组的交集(注意集合是不能含有重复的元素的) 方法1) 先对两个数组进行排序,设置两个指针pA和pB,分别指向这两个数组,比较nums1[pA]和nums[ 阅读全文
posted @ 2016-06-18 23:00 Shirley_ICT 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 记住的单词: vegan:严格的素食主意者 charity: 慈善 poultry:家禽 soya:大豆 stuff:东西 minimise:求最小值 celebrity:名人,名声 preach:说教 anniversary:周年纪念日 actions speak louder than word 阅读全文
posted @ 2016-06-18 17:12 Shirley_ICT 阅读(120) 评论(0) 推荐(0) 编辑