上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: 题目描述:(链接)Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.解题思路: 1 class Solution { 2 public: ... 阅读全文
posted @ 2015-11-12 18:15 skycore 阅读(128) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Write a function to find the longest common prefix string amongst an array of strings.解题思路:两两比较。 1 class Solution { 2 public: 3 string lo... 阅读全文
posted @ 2015-11-12 10:22 skycore 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Given a string containing just the characters'(',')','{','}','['and']', determine if the input string is valid.The brackets must close in the... 阅读全文
posted @ 2015-11-12 10:09 skycore 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Given two sorted integer arraysnums1andnums2, mergenums2intonums1as one sorted array.Note:You may assume thatnums1has enough space (size that... 阅读全文
posted @ 2015-11-12 09:55 skycore 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1is read off as"one 1"or11.11is read ... 阅读全文
posted @ 2015-11-11 22:42 skycore 阅读(159) 评论(0) 推荐(0) 编辑
摘要: Numpy:numpy提供两种基本的对象:ndarray和ufunc,ndarray是存储单一数据类型的多为数组,ufunc是能够对数组进行操作的函数。1.ndarray对象创建数组:a = numpy.array([1, 2, 3, 4])b = np.array([[1, 2, 3, 4], [... 阅读全文
posted @ 2015-11-10 14:49 skycore 阅读(437) 评论(0) 推荐(1) 编辑
摘要: 题目描述:(链接)Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.For example,"A man, a plan, a ca... 阅读全文
posted @ 2015-11-09 23:27 skycore 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Remove all elements from a linked list of integers that have valueval.ExampleGiven:1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6,val= 6Return:1 --> 2... 阅读全文
posted @ 2015-11-08 22:23 skycore 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Given a singly linked list, determine if it is a palindrome.解题思路:使用快慢指针,找到链表的中心点,然后逆序后一半链表,最后再一一比较! 1 /** 2 * Definition for singly-linked l... 阅读全文
posted @ 2015-11-07 23:54 skycore 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 题目描述:(链接)Determine whether an integer is a palindrome. Do this without extra space.解题思路:分离出首位,末位,分别比较! 1 class Solution { 2 public: 3 bool isPalin... 阅读全文
posted @ 2015-11-07 23:12 skycore 阅读(179) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页