不为成仙,只为在这红尘中等你回来。

350. Intersection of Two Arrays II [Easy]

    ### 题意 Given two arrays, write a function to compute their intersection. 给定两个数组,写一个方法来计算它们的交集。 Example: ``` Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2]. ``` Note: - Each element in the result should appear as many times...

    阅读全文>>

2018年5月15日 10:29 作者:nancy 分类:[LeetCode] 1241

349. Intersection of Two Arrays [Easy]

    ### 题意 Given two arrays, write a function to compute their intersection. 给定两个数组,写一个函数来计算它们的交集。 Example: ``` Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2]. ``` Note: - Each element in the result must be unique. - 每个在结果中的元素必定...

    阅读全文>>

2018年5月15日 09:28 作者:nancy 分类:[LeetCode] 1377

242. Valid Anagram [Easy] [Sort | Hash Table]

    ### 题意 Given two strings s and t, write a function to determine if t is an anagram of s. 给定两个字符串 s 和 t,编写函数判断 t 是否为 s 的 anagram (字谜游戏,由颠倒字母顺序而构成的字[短语])。 Example 1: ``` Input: s = "anagram", t = "nagaram" Output: true ``` Example 2: ``...

    阅读全文>>

2018年5月13日 20:59 作者:nancy 分类:[LeetCode] 1230