上一页 1 ··· 5 6 7 8 9 10 下一页
摘要: 问题: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0?Find all unique triplets in the array which gives the sum 阅读全文
posted @ 2016-10-13 10:29 Gerrard_Feng 阅读(257) 评论(0) 推荐(1)
摘要: 问题: Write a function to find the longest common prefix string amongst an array of strings. 官方难度: Easy 翻译: 寻找一个字符串数组的最长公共前缀。 方法一: 方法一的解题代码: 1 private s 阅读全文
posted @ 2016-10-12 09:51 Gerrard_Feng 阅读(275) 评论(0) 推荐(1)
摘要: 在介绍冒泡排序之前,优先介绍一种算法设计的策略——蛮力法。这是一种简单直接的解决问题的方法,常常直接基于问题的描述和所涉及的定义。由于蛮力法是基于问题的定义来思考的,那么可以说它是一种几乎什么问题都能解决的一般性的方法。当然,缺点也是显而易见的,那就是“笨”,即解决方法的过程既不巧妙,也不高效。而冒 阅读全文
posted @ 2016-10-12 08:01 Gerrard_Feng 阅读(1729) 评论(0) 推荐(1)
摘要: 问题: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 官方难度: Easy 翻译: 将一个范围在1-3999的罗马字符,转化成整数形 阅读全文
posted @ 2016-10-11 10:03 Gerrard_Feng 阅读(252) 评论(0) 推荐(1)
摘要: 题目: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 官方难度: Medium 翻译: 给定一个范围在1-3999内的整数,将其转化 阅读全文
posted @ 2016-10-10 10:16 Gerrard_Feng 阅读(388) 评论(0) 推荐(1)
摘要: 问题: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two e 阅读全文
posted @ 2016-10-09 10:07 Gerrard_Feng 阅读(399) 评论(0) 推荐(1)
摘要: 问题: Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem 阅读全文
posted @ 2016-09-30 13:27 Gerrard_Feng 阅读(391) 评论(0) 推荐(1)
摘要: 问题: Determine whether an integer is a palindrome. Do this without extra space. 官方难度: Easy 翻译: 不使用额外空间,判断一个数是不是回文形式。 解题代码: 1 public static boolean isPa 阅读全文
posted @ 2016-09-28 00:02 Gerrard_Feng 阅读(266) 评论(0) 推荐(1)
摘要: 问题: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. 官方难度: Easy 翻译: 实现atoi功能,将一个字符串转化成一个整数。 提示:仔细考 阅读全文
posted @ 2016-09-27 23:43 Gerrard_Feng 阅读(271) 评论(0) 推荐(1)
摘要: 问题: Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321 官方难度: Easy 翻译: 将一个整数倒转输出。 例子: 整数:123,倒转输出:321。 整数:-123,倒转输 阅读全文
posted @ 2016-09-27 14:02 Gerrard_Feng 阅读(233) 评论(0) 推荐(1)
上一页 1 ··· 5 6 7 8 9 10 下一页