随笔分类 - 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
阅读全文
摘要:Divide two integers without using multiplication, division and mod operator. If it is overflow, return 2147483647 Divide two integers without using mu
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. Notice Have you consider that the string
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. Given a string containing just
阅读全文
摘要:Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another e
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. Given n pairs of parentheses, write a function
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文
摘要: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
阅读全文