随笔分类 -  LintCode

摘要:Reverse digits of an integer. Returns 0 when the reversed integer overflows (signed 32-bit integer). Reverse digits of an integer. Returns 0 when the 阅读全文
posted @ 2016-08-16 23:28 Grandyang 阅读(3321) 评论(0) 推荐(0) 编辑
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Divide two integers without using mu 阅读全文
posted @ 2016-08-08 23:52 Grandyang 阅读(1419) 评论(0) 推荐(0) 编辑
摘要:Validate if a given string is numeric. Have you met this question in a real interview? Yes Validate if a given string is numeric. Validate if a given 阅读全文
posted @ 2016-08-07 23:44 Grandyang 阅读(760) 评论(0) 推荐(0) 编辑
摘要:Given an integer array nums with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer ta 阅读全文
posted @ 2016-08-06 12:00 Grandyang 阅读(2638) 评论(4) 推荐(0) 编辑
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Notice Have you consider that the string 阅读全文
posted @ 2016-08-03 02:51 Grandyang 阅读(505) 评论(0) 推荐(0) 编辑
摘要:Given an integer, convert it to a roman numeral. The number is guaranteed to be within the range from 1 to 3999. Given an integer, convert it to a rom 阅读全文
posted @ 2016-08-01 09:24 Grandyang 阅读(708) 评论(0) 推荐(0) 编辑
摘要:Given a roman numeral, convert it to an integer. The answer is guaranteed to be within the range from 1 to 3999. Have you met this question in a real 阅读全文
posted @ 2016-07-31 23:03 Grandyang 阅读(641) 评论(0) 推荐(0) 编辑
摘要:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representati 阅读全文
posted @ 2016-07-30 23:46 Grandyang 阅读(874) 评论(0) 推荐(0) 编辑
摘要:The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 1 is read off as "one 1" or 11. 11 is read o 阅读全文
posted @ 2016-07-29 06:52 Grandyang 阅读(1047) 评论(0) 推荐(0) 编辑
摘要:Given an absolute path for a file (Unix-style), simplify it. Given an absolute path for a file (Unix-style), simplify it. Have you met this question i 阅读全文
posted @ 2016-07-28 23:54 Grandyang 阅读(703) 评论(0) 推荐(0) 编辑
摘要:Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2016-07-27 23:35 Grandyang 阅读(487) 评论(0) 推荐(0) 编辑
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Given a string containing just 阅读全文
posted @ 2016-07-26 22:45 Grandyang 阅读(963) 评论(0) 推荐(0) 编辑
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e 阅读全文
posted @ 2016-07-24 23:59 Grandyang 阅读(1795) 评论(0) 推荐(0) 编辑
摘要:Given an array A of integer with size of n( means n books and number of pages of each book) and k people to copy the book. You must distribute the con 阅读全文
posted @ 2016-07-23 23:49 Grandyang 阅读(1980) 评论(0) 推荐(0) 编辑
摘要:Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
posted @ 2016-07-20 23:31 Grandyang 阅读(1109) 评论(0) 推荐(0) 编辑
摘要:Given a string containing only digits, restore it by returning all possible valid IP address combinations. Have you met this question in a real interv 阅读全文
posted @ 2016-07-19 23:48 Grandyang 阅读(936) 评论(0) 推荐(0) 编辑
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n pairs of parentheses, write a function 阅读全文
posted @ 2016-07-18 23:39 Grandyang 阅读(785) 评论(0) 推荐(0) 编辑
摘要:Implement pow(x, n). Notice You don't need to care about the precision of your answer, it's acceptable if the expected answer and your answer 's diffe 阅读全文
posted @ 2016-07-17 23:54 Grandyang 阅读(1339) 评论(0) 推荐(0) 编辑
摘要:Given a boolean 2D matrix, find the number of islands. Notice 0 is represented as the sea, 1 is represented as the island. If two 1 is adjacent, we co 阅读全文
posted @ 2016-07-15 11:09 Grandyang 阅读(907) 评论(0) 推荐(0) 编辑
摘要:Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. Given a 2D binary matrix filled with 阅读全文
posted @ 2016-07-14 23:41 Grandyang 阅读(933) 评论(0) 推荐(0) 编辑

Fork me on GitHub