随笔分类 -  LeetCode

上一页 1 ··· 34 35 36 37 38 39 40 41 42 ··· 61 下一页
摘要:Now you are given a string S, which represents a software license key which we would like to format. The string S is composed of alphanumerical charac 阅读全文
posted @ 2017-01-12 14:02 Grandyang 阅读(6475) 评论(0) 推荐(0) 编辑
摘要:Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given inte 阅读全文
posted @ 2017-01-11 23:55 Grandyang 阅读(8883) 评论(1) 推荐(0) 编辑
摘要: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 阅读(21730) 评论(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 阅读(9846) 评论(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 阅读(9876) 评论(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 阅读(9753) 评论(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 阅读(17138) 评论(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 阅读(12297) 评论(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 阅读(18490) 评论(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 阅读(22212) 评论(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 阅读(14611) 评论(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 阅读(10278) 评论(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 阅读(22462) 评论(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 阅读(13446) 评论(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 阅读(13586) 评论(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 阅读(10660) 评论(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 阅读(12627) 评论(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 阅读(7911) 评论(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 阅读(8485) 评论(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 阅读(7573) 评论(3) 推荐(1) 编辑

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