摘要: Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Example 2: Example 3: 阅读全文
posted @ 2017-10-23 21:51 daniel456 阅读(115) 评论(0) 推荐(0) 编辑
摘要: TinyURL is a URL shortening service where you enter a URL such as https://leetcode.com/problems/design-tinyurl and it returns a short URL such as http 阅读全文
posted @ 2017-10-23 21:42 daniel456 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, every element appears twice except for one. Find that single one. 题目含义:给定的数组中,每个数字出现两次,只有一个数字出现了一次,找出这个数字 阅读全文
posted @ 2017-10-23 21:21 daniel456 阅读(94) 评论(0) 推荐(0) 编辑
摘要: Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants represented by strings. You need to h 阅读全文
posted @ 2017-10-23 21:20 daniel456 阅读(158) 评论(0) 推荐(0) 编辑
摘要: We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1. Now, given an integer arra 阅读全文
posted @ 2017-10-23 21:15 daniel456 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of th 阅读全文
posted @ 2017-10-23 21:12 daniel456 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 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 阅读(78) 评论(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 阅读(100) 评论(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 阅读(174) 评论(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 阅读(141) 评论(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 阅读(108) 评论(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 阅读(116) 评论(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 阅读(108) 评论(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 阅读(130) 评论(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 阅读(128) 评论(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 阅读(113) 评论(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 阅读(128) 评论(0) 推荐(0) 编辑
摘要: Given two arrays, write a function to compute their intersection. 题目含义z:计算两个数组的交集,重复的数字要保留 阅读全文
posted @ 2017-10-23 13:55 daniel456 阅读(116) 评论(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 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given the root of a binary tree, then value v and depth d, you need to add a row of nodes with value v at the given depth d. The root node is at depth 阅读全文
posted @ 2017-10-23 11:19 daniel456 阅读(133) 评论(0) 推荐(0) 编辑