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 阅读全文
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) 编辑
摘要: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  阅读全文
posted @ 2016-07-25 23:19 Grandyang 阅读(23994) 评论(19) 推荐(2) 编辑
摘要: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) 编辑
摘要:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The 阅读全文
posted @ 2016-07-22 23:57 Grandyang 阅读(11667) 评论(7) 推荐(1) 编辑
摘要:在Maya中,我们可以用脚本来控制物体的自转方向,速度等等,步骤如下: 选择需要操作的物体object,打开通道盒Channel Box,点击编辑Edit,打开表达式Expressions面板 选择需要转动轴rotateX, rotateY, 或者rotateZ 然后在下面输入: 上面的代码表示物体 阅读全文
posted @ 2016-07-21 02:12 Grandyang 阅读(1429) 评论(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) 编辑
摘要: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 阅读全文
posted @ 2016-07-16 23:48 Grandyang 阅读(22681) 评论(10) 推荐(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) 编辑
摘要: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 阅读全文
posted @ 2016-07-13 12:40 Grandyang 阅读(12165) 评论(8) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-12 11:50 Grandyang 阅读(990) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-11 10:00 Grandyang 阅读(1726) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-10 09:59 Grandyang 阅读(1578) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-09 23:37 Grandyang 阅读(3864) 评论(3) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-08 13:39 Grandyang 阅读(17699) 评论(2) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-07 23:51 Grandyang 阅读(12098) 评论(5) 推荐(2) 编辑
摘要: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 阅读全文
posted @ 2016-07-06 23:12 Grandyang 阅读(629) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-05 22:53 Grandyang 阅读(604) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-04 23:44 Grandyang 阅读(1070) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-03 12:46 Grandyang 阅读(2334) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-02 12:32 Grandyang 阅读(2248) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2016-07-01 08:43 Grandyang 阅读(23710) 评论(10) 推荐(2) 编辑

Fork me on GitHub