摘要: Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array. Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional elements from nums2. The number of elements initialized in nums1 andnums2 are m and n respectively. 阅读全文
posted @ 2015-09-01 15:38 TinaYo 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 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 climb to the top? 阅读全文
posted @ 2015-08-31 16:55 TinaYo 阅读(201) 评论(0) 推荐(0) 编辑
摘要: Given two binary strings, return their sum (also a binary string). 阅读全文
posted @ 2015-08-28 10:44 TinaYo 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 这篇文章给出了感知机学习算法,并用Python实现之 阅读全文
posted @ 2015-08-27 18:51 TinaYo 阅读(398) 评论(0) 推荐(0) 编辑
摘要: 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 at the head of the list. 阅读全文
posted @ 2015-08-26 14:10 TinaYo 阅读(186) 评论(0) 推荐(0) 编辑
摘要: The count-and-say sequence is the sequence of integers beginning as follows: 1, 11, 21, 1211, 111221, ... 阅读全文
posted @ 2015-08-25 14:09 TinaYo 阅读(168) 评论(-1) 推荐(0) 编辑
摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 阅读全文
posted @ 2015-08-20 18:27 TinaYo 阅读(215) 评论(0) 推荐(0) 编辑
摘要: Given an array and a value, remove all instances of that value in place and return the new length. The order of elements can be changed. It doesn't matter what you leave beyond the new length. 阅读全文
posted @ 2015-08-19 10:37 TinaYo 阅读(158) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space for another array, you must do this in place with constant memory. 阅读全文
posted @ 2015-08-18 17:48 TinaYo 阅读(141) 评论(0) 推荐(0) 编辑
摘要: Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 阅读全文
posted @ 2015-08-18 17:45 TinaYo 阅读(149) 评论(0) 推荐(0) 编辑