07 2016 档案
摘要: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
阅读全文
摘要:Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target. The answer is
阅读全文
摘要: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
阅读全文
摘要:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The
阅读全文
摘要:在Maya中,我们可以用脚本来控制物体的自转方向,速度等等,步骤如下: 选择需要操作的物体object,打开通道盒Channel Box,点击编辑Edit,打开表达式Expressions面板 选择需要转动轴rotateX, rotateY, 或者rotateZ 然后在下面输入: 上面的代码表示物体
阅读全文
摘要: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
阅读全文
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron
阅读全文
摘要: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
阅读全文
摘要:We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron
阅读全文
摘要:The structure of Segment Tree is a binary tree which each node has two attributes startand end denote an segment / interval. start and end are both in
阅读全文
摘要:The structure of Segment Tree is a binary tree which each node has two attributes start and end denote an segment / interval. start and end are both i
阅读全文
摘要:Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then l
阅读全文
摘要:Design a parking lot. see CC150 OO Design for details.1) n levels, each level has m rows of spots and each row has k spots.So each level has m x k spo
阅读全文
摘要:You are given two integer arrays nums1 and nums2 sorted in ascending order and an integer k. Define a pair (u, v) which consists of one element from t
阅读全文
摘要:Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array. Exampl
阅读全文
摘要:Given a linked list, swap every two adjacent nodes and return its head. Given a linked list, swap every two adjacent nodes and return its head. Exampl
阅读全文
摘要:Remove all elements from a linked list of integers that have value val. Remove all elements from a linked list of integers that have value val. Have y
阅读全文
摘要:Flatten a binary tree to a fake "linked list" in pre-order traversal. Here we use the right pointer in TreeNode as the next pointer in ListNode. Notic
阅读全文
摘要:Given an integer array, sort it in ascending order. Use quick sort, merge sort, heap sort or any O(nlogn) algorithm. Given an integer array, sort it i
阅读全文
摘要:Given an integer array, sort it in ascending order. Use selection sort, bubble sort, insertion sort or any O(n2) algorithm. Given an integer array, so
阅读全文
摘要:Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Example 1: Input: a = 1, b = 2 Output: 3 Example 2: In
阅读全文