随笔分类 -  leetcode_hashTable

摘要:Given two strings s and t, write a function to determine if t is an anagram of s. For example,s = "anagram", t = "nagaram", return true.s = "rat", t = 阅读全文
posted @ 2017-10-23 21:05 daniel456 阅读(79) 评论(0) 推荐(0) 编辑
摘要: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 i 阅读全文
posted @ 2017-10-23 21:00 daniel456 阅读(102) 评论(0) 推荐(0) 编辑
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-10-23 20:58 daniel456 阅读(175) 评论(0) 推荐(0) 编辑
摘要:Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at 阅读全文
posted @ 2017-10-23 20:52 daniel456 阅读(143) 评论(0) 推荐(0) 编辑
摘要:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters. This 阅读全文
posted @ 2017-10-23 20:49 daniel456 阅读(110) 评论(0) 推荐(0) 编辑
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2017-10-23 20:45 daniel456 阅读(117) 评论(0) 推荐(0) 编辑
摘要:Given n points in the plane that are all pairwise distinct, a "boomerang" is a tuple of points (i, j, k) such that the distance between iand j equals 阅读全文
posted @ 2017-10-23 20:15 daniel456 阅读(109) 评论(0) 推荐(0) 编辑
摘要:ou are given a map in form of a two-dimensional integer grid where 1 represents land and 0 represents water. Grid cells are connected horizontally/ver 阅读全文
posted @ 2017-10-23 20:08 daniel456 阅读(131) 评论(0) 推荐(0) 编辑
摘要:Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文
posted @ 2017-10-23 20:05 daniel456 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2017-10-23 20:00 daniel456 阅读(114) 评论(0) 推荐(0) 编辑
摘要:You are given a data structure of employee information, which includes the employee's unique id, his importance value and his directsubordinates' id. 阅读全文
posted @ 2017-10-23 19:49 daniel456 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Given two arrays, write a function to compute their intersection. 题目含义z:计算两个数组的交集,重复的数字要保留 阅读全文
posted @ 2017-10-23 13:55 daniel456 阅读(117) 评论(0) 推荐(0) 编辑
摘要:Given a binary tree, return the inorder traversal of its nodes' values. For example:Given binary tree [1,null,2,3], return [1,3,2]. 题目含义:用中序遍历树并输出 阅读全文
posted @ 2017-10-23 11:20 daniel456 阅读(111) 评论(0) 推荐(0) 编辑
摘要:Given the root of a tree, you are asked to find the most frequent subtree sum. The subtree sum of a node is defined as the sum of all the node values 阅读全文
posted @ 2017-10-22 21:28 daniel456 阅读(132) 评论(0) 推荐(0) 编辑
摘要:Given a binary search tree (BST) with duplicates, find all the mode(s) (the most frequently occurred element) in the given BST. Assume a BST is define 阅读全文
posted @ 2017-10-21 22:54 daniel456 阅读(127) 评论(0) 推荐(0) 编辑
摘要:The set S originally contains numbers from 1 to n. But unfortunately, due to the data error, one of the numbers in the set got duplicated to another n 阅读全文
posted @ 2017-10-20 21:53 daniel456 阅读(130) 评论(0) 推荐(0) 编辑
摘要:ount the number of prime numbers less than a non-negative number, n. 题目含义:要求计算小于N的所有素数的个数。素数又称质数,是只能被1和自身整数的数 思路:厄拉多塞筛法 西元前250年,希腊数学家厄拉多塞(Eeatosthese) 阅读全文
posted @ 2017-10-20 20:25 daniel456 阅读(107) 评论(0) 推荐(0) 编辑
摘要:Write an algorithm to determine if a number is "happy". A happy number is a number defined by the following process: Starting with any positive intege 阅读全文
posted @ 2017-10-20 20:14 daniel456 阅读(163) 评论(0) 推荐(0) 编辑
摘要:Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups of dup 阅读全文
posted @ 2017-10-18 15:37 daniel456 阅读(130) 评论(0) 推荐(0) 编辑
摘要:Given an array of strings, group anagrams together. For example, given: ["eat", "tea", "tan", "ate", "nat", "bat"], Return: Note: All inputs will be i 阅读全文
posted @ 2017-10-18 10:05 daniel456 阅读(94) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示