2016年5月4日

Roman To Integer

摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 这题比Integer To Roman简单很多,主要是考虑有没有左减的存在。实际觉得 阅读全文

posted @ 2016-05-04 22:30 Sheryl Wang 阅读(95) 评论(0) 推荐(0) 编辑

Integer to Roman

摘要: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 将整数转化为罗马数字。需要知道一些罗马数字的规则,具体见维基百科。主要需要注意的是左 阅读全文

posted @ 2016-05-04 22:25 Sheryl Wang 阅读(171) 评论(0) 推荐(0) 编辑

2016年4月30日

Climbing Stairs

摘要: You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you cl 阅读全文

posted @ 2016-04-30 16:41 Sheryl Wang 阅读(106) 评论(0) 推荐(0) 编辑

Pascal's Triangle II

摘要: Given an index k, return the kth row of the Pascal's triangle. For example, given k = 3,Return [1,3,3,1]. Pascal's Triangle为给出行数,求所有结果,这题是给出任意行号,求该行的结 阅读全文

posted @ 2016-04-30 15:49 Sheryl Wang 阅读(167) 评论(0) 推荐(0) 编辑

Pascal's Triangle

摘要: Given numRows, generate the first numRows of Pascal's triangle. For example, given numRows = 5,Return 简单题,不过却有解法上还是有多种的。首先给出我简单直接的解法: 主要就是每行处理,将开始的1和最 阅读全文

posted @ 2016-04-30 15:32 Sheryl Wang 阅读(155) 评论(0) 推荐(0) 编辑

2016年4月29日

Unique Binary Search Trees II

摘要: Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. For example,Given n = 3, your program should return all 阅读全文

posted @ 2016-04-29 21:34 Sheryl Wang 阅读(159) 评论(0) 推荐(0) 编辑

2016年4月28日

Unique Binary Search Trees

摘要: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example,Given n = 3, there are a total of 5 unique BST' 阅读全文

posted @ 2016-04-28 22:49 Sheryl Wang 阅读(163) 评论(0) 推荐(0) 编辑

Plus One

摘要: Given a non-negative number represented as an array of digits, plus one to the number. The digits are stored such that the most significant digit is a 阅读全文

posted @ 2016-04-28 11:43 Sheryl Wang 阅读(202) 评论(0) 推荐(0) 编辑

2016年4月27日

Palindrome Number

摘要: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi 阅读全文

posted @ 2016-04-27 16:57 Sheryl Wang 阅读(122) 评论(0) 推荐(0) 编辑

Remove Element

摘要: Given an array and a value, remove all instances of that value in place and return the new length. Do not allocate extra space for another array, you 阅读全文

posted @ 2016-04-27 11:32 Sheryl Wang 阅读(128) 评论(0) 推荐(0) 编辑

导航