
Hash Table
文章平均质量分 71
dyllanzhou
这个作者很懒,什么都没留下…
展开
-
[Leetcode]H-Index
Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher's h-index. According to the definition of h-index on Wikipedia: "A原创 2015-11-04 14:50:14 · 272 阅读 · 0 评论 -
[Leetcode]Intersection of Two Arrays II
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 ti原创 2016-06-21 12:23:53 · 359 阅读 · 0 评论 -
[Leetcode]Intersection of Two Arrays
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.The result c原创 2016-06-20 18:37:36 · 261 阅读 · 0 评论 -
[Leetcode]Longest Substring Without Repeating Characters
Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. For原创 2015-11-14 16:57:23 · 248 阅读 · 0 评论 -
[Leetcode]Gray Code
The gray code is a binary numeral system where two successive values differ in only one bit. Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr原创 2015-09-23 18:40:12 · 296 阅读 · 0 评论 -
[Leetcode]Binary Tree Inorder Traversal
Given a binary tree, return the inorder traversal of its nodes' values. For example: Given binary tree {1,#,2,3}, 1 \ 2 / 3 return [1,3,2]. Note: Recursive solution is trivi原创 2015-09-22 11:44:33 · 305 阅读 · 0 评论 -
[Leetcode]Linked List Cycle II
Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Note: Do not modify the linked list. Follow up: Can you solve it without using extra space? /**原创 2015-10-08 15:00:09 · 215 阅读 · 0 评论 -
[Leetcode]Word Pattern
Given a pattern and a string str, find if str follows the same pattern. Examples: pattern = "abba", str = "dog cat cat dog" should return true.pattern = "abba", str = "dog cat cat fish" should r原创 2015-10-06 19:15:06 · 309 阅读 · 0 评论 -
[Leetcode]Group Anagrams
Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: [ ["ate", "eat","tea"], ["nat","tan"], ["bat"] ] Note: For t原创 2015-11-05 15:08:52 · 251 阅读 · 0 评论 -
[Leetcode]Ransom Note
Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be construc原创 2016-08-22 15:17:32 · 480 阅读 · 0 评论