leetcode
文章平均质量分 55
HeMingisCoding
这个作者很懒,什么都没留下…
展开
-
【LeetCode27】【Remove Element】
1.题目原文: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 must do this in place with constant memory.Th原创 2017-05-07 09:18:42 · 462 阅读 · 0 评论 -
【LeetCode7】【Reverse Integer】java中整形正负表示的一些思考
7.Reverse IntegerReverse digits of an integer.Example1: x = 123, return 321 Example2: x = -123, return -321Note:原创 2017-04-25 14:53:55 · 673 阅读 · 0 评论 -
【LeetCode13】【Roman to Integer】
题目:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.原创 2017-04-27 11:19:25 · 484 阅读 · 0 评论 -
【LeetCode14】【Longest Common Prefix】
题目如下:Write a function to find the longest common prefix string amongst an array of strings. 意思就是说写一个方法返回一个字符串数组中每个字符串共有的开头。比如:{“1235”,”152”,”14”},就要返回”1”;又或者{“2235”,”52”,”41”},就要返回”“(空字符串)。原创 2017-04-28 20:46:06 · 295 阅读 · 0 评论 -
【LeetCode20】【Valid Parentheses】
题目:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.原创 2017-05-04 11:39:17 · 639 阅读 · 0 评论 -
【LeetCode21】【Merge Two Sorted Lists】递归实现
题目原文: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.题意理解:题目的意思是说把两个排好序的list,合并成一个新的排好序的list,并返回。原创 2017-05-04 17:27:36 · 831 阅读 · 0 评论 -
【LeetCode26】【Remove Duplicates from Sorted Array】
题目: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 cons原创 2017-05-06 21:06:17 · 561 阅读 · 0 评论 -
【LeetCode28】【 Implement strStr()】length,length(),size()
1.题目原文:Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.2.题意解读:needle,haystack两个数组,返回haystack中首次出现needle的位置索引,如果没有出现,就返回-1。原创 2017-05-07 11:05:44 · 585 阅读 · 0 评论 -
【LeetCode35】【Search Insert Position】二分法查找
题目原文Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.二分法查找原创 2017-05-07 16:20:29 · 376 阅读 · 0 评论 -
【LeetCode38】【Count and Say】StringBuilder
1. 题目原文The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...我认为比较好的示例应该是这样的:<1 1(经测试,是可以通过的)1 12 11(1个1)3 21(2个1)4 1211(1个2,1个1)原创 2017-05-10 00:31:46 · 355 阅读 · 0 评论