2014年10月17日
摘要: Problem:Given an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three integer... 阅读全文
posted @ 2014-10-17 12:29 higerzhang 阅读(291) 评论(0) 推荐(0) 编辑
  2014年10月16日
摘要: Problem:Given an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Not... 阅读全文
posted @ 2014-10-16 22:41 higerzhang 阅读(306) 评论(0) 推荐(0) 编辑
摘要: Problems:Write a function to find the longest common prefix string amongst an array of strings.就是返回一个字符串数组的所有的公共前缀。不难。我是已第一个字符串为参考,然后依次遍历其他的字符串,一旦遇到不同... 阅读全文
posted @ 2014-10-16 00:07 higerzhang 阅读(189) 评论(0) 推荐(0) 编辑
摘要: Problem:Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.遍历一次输入的字符串,如果不满足类似4或者9的就直接加相应的数,否则减去... 阅读全文
posted @ 2014-10-16 00:00 higerzhang 阅读(208) 评论(0) 推荐(0) 编辑
  2014年10月15日
摘要: Problem:Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.把阿拉伯数字转换为罗马数字输出。百度一下对应的 I V X L C D ... 阅读全文
posted @ 2014-10-15 00:53 higerzhang 阅读(287) 评论(0) 推荐(0) 编辑
摘要: Problem:Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpo... 阅读全文
posted @ 2014-10-15 00:07 higerzhang 阅读(440) 评论(0) 推荐(0) 编辑
  2014年10月14日
摘要: Problem:Implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the precedin... 阅读全文
posted @ 2014-10-14 00:30 higerzhang 阅读(439) 评论(0) 推荐(0) 编辑
  2014年10月13日
摘要: Problem:Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindr... 阅读全文
posted @ 2014-10-13 10:08 higerzhang 阅读(169) 评论(0) 推荐(0) 编辑
摘要: Problem:Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, please do not see be... 阅读全文
posted @ 2014-10-13 00:15 higerzhang 阅读(271) 评论(1) 推荐(0) 编辑
  2014年10月12日
摘要: Problem:Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321终于什么都没参考就一次Accept了。可能是这题比较简单,同时自己也进步了一点点,leetcode就是这样给我... 阅读全文
posted @ 2014-10-12 21:02 higerzhang 阅读(333) 评论(1) 推荐(0) 编辑