导航

上一页 1 2 3 4 5 6 7 ··· 12 下一页

2016年9月19日

摘要: Determine whether an integer is a palindrome. Do this without extra space. 判断一个数是否是回文数,不能用额外的空间 我第一次做的时候,没有考虑到不能用额外的空间(空间复杂度为(n)),用了一个字符串来保存数字,而且题目的设定 阅读全文

posted @ 2016-09-19 17:33 CSU蛋李 阅读(141) 评论(0) 推荐(0) 编辑

摘要: Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 罗马数字:可以查看维基百科的定义 . 最大为MMMCMXCIX,我们需要注意的是9的 阅读全文

posted @ 2016-09-19 16:27 CSU蛋李 阅读(139) 评论(0) 推荐(0) 编辑

2016年9月18日

摘要: Write a function to find the longest common prefix string amongst an array of strings. 让我们在一个字符串中找出所有字符串的共同前缀 阅读全文

posted @ 2016-09-18 23:39 CSU蛋李 阅读(107) 评论(0) 推荐(0) 编辑

摘要: Given a linked list, remove the nth node from the end of list and return its head. For example, Note:Given n will always be valid.Try to do this in on 阅读全文

posted @ 2016-09-18 23:18 CSU蛋李 阅读(128) 评论(0) 推荐(0) 编辑

摘要: Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文

posted @ 2016-09-18 17:18 CSU蛋李 阅读(112) 评论(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 @ 2016-09-18 16:52 CSU蛋李 阅读(85) 评论(0) 推荐(0) 编辑

摘要: Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文

posted @ 2016-09-18 16:39 CSU蛋李 阅读(88) 评论(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 fo 阅读全文

posted @ 2016-09-18 16:10 CSU蛋李 阅读(116) 评论(0) 推荐(0) 编辑

2016年9月17日

摘要: Implement strStr(). Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack. 这个题目就是在一个字符串中找到另外一个字符串第一 阅读全文

posted @ 2016-09-17 17:06 CSU蛋李 阅读(126) 评论(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 off 阅读全文

posted @ 2016-09-17 16:50 CSU蛋李 阅读(127) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 ··· 12 下一页