随笔分类 -  LeetCode

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 61 下一页
摘要:Design and implement a data structure for Least Frequently Used (LFU) cache. It should support the following operations: get and put. get(key) - Get t 阅读全文
posted @ 2017-01-07 03:47 Grandyang 阅读(21584) 评论(11) 推荐(0) 编辑
摘要:Given an array of strings words (without duplicates), return all the concatenated words in the given list of words. A concatenated word is defined as 阅读全文
posted @ 2017-01-05 23:59 Grandyang 阅读(9793) 评论(5) 推荐(1) 编辑
摘要:Remember the story of Little Match Girl? By now, you know exactly what matchsticks the little match girl has, please find out a way you can make one s 阅读全文
posted @ 2016-12-30 22:07 Grandyang 阅读(9818) 评论(6) 推荐(1) 编辑
摘要:Given a string, sort it in decreasing order based on the frequency of characters. Example 1: Input: "tree" Output: "eert" Explanation: 'e' appears twi 阅读全文
posted @ 2016-12-29 03:56 Grandyang 阅读(9703) 评论(4) 推荐(1) 编辑
摘要:Given a root node reference of a BST and a key, delete the node with the given key in the BST. Return the root node reference (possibly updated) of th 阅读全文
posted @ 2016-12-28 09:33 Grandyang 阅读(16988) 评论(9) 推荐(0) 编辑
摘要:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, or 阅读全文
posted @ 2016-12-27 06:12 Grandyang 阅读(12271) 评论(13) 推荐(0) 编辑
摘要:Given an array of integers where 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements of [1, n] 阅读全文
posted @ 2016-12-26 14:16 Grandyang 阅读(18448) 评论(3) 推荐(0) 编辑
摘要:You are given two linked lists representing two non-negative numbers. The most significant digit comes first and each of their nodes contain a single 阅读全文
posted @ 2016-12-23 23:55 Grandyang 阅读(22143) 评论(0) 推荐(1) 编辑
摘要:Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others appear once. Find all the elements that appear twi 阅读全文
posted @ 2016-12-22 05:36 Grandyang 阅读(14542) 评论(0) 推荐(0) 编辑
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to find the total 阅读全文
posted @ 2016-12-21 16:08 Grandyang 阅读(10238) 评论(2) 推荐(1) 编辑
摘要:The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul 阅读全文
posted @ 2016-12-20 01:05 Grandyang 阅读(22425) 评论(8) 推荐(1) 编辑
摘要:Given a non-empty string, encode the string such that its encoded length is the shortest. The encoding rule is: k[encoded_string], where the encoded_s 阅读全文
posted @ 2016-12-18 14:12 Grandyang 阅读(13414) 评论(15) 推荐(0) 编辑
摘要:In the computer world, use restricted resource you have to generate maximum benefit is what we always want to pursue. For now, suppose you are a domin 阅读全文
posted @ 2016-12-16 23:53 Grandyang 阅读(13529) 评论(3) 推荐(1) 编辑
摘要:In this problem, your job to write a function to check whether a input string is a valid IPv4 address or IPv6 address or neither. IPv4 addresses are c 阅读全文
posted @ 2016-12-15 23:53 Grandyang 阅读(10601) 评论(0) 推荐(1) 编辑
摘要:Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses. Now, you are given p 阅读全文
posted @ 2016-12-14 23:45 Grandyang 阅读(12554) 评论(8) 推荐(0) 编辑
摘要:Define S = [s,n] as the string S which consists of n connected strings s. For example, ["abc", 3] ="abcabcabc". On the other hand, we define that stri 阅读全文
posted @ 2016-12-09 14:06 Grandyang 阅读(7869) 评论(5) 推荐(0) 编辑
摘要:Given a list of points that form a polygon when joined sequentially, find if this polygon is convex (Convex polygon definition). Note: Example 1: Exam 阅读全文
posted @ 2016-12-08 22:29 Grandyang 阅读(8444) 评论(3) 推荐(0) 编辑
摘要:Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstuvwxyza 阅读全文
posted @ 2016-12-07 22:25 Grandyang 阅读(7538) 评论(3) 推荐(1) 编辑
摘要:Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
posted @ 2016-12-06 14:07 Grandyang 阅读(5317) 评论(3) 推荐(0) 编辑
摘要:A group of friends went on holiday and sometimes lent each other money. For example, Alice paid for Bill's lunch for $10. Then later Chris gave Alice 阅读全文
posted @ 2016-11-28 08:24 Grandyang 阅读(18400) 评论(5) 推荐(0) 编辑

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 61 下一页
Fork me on GitHub