摘要:
问题: 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 阅读全文
摘要:
问题: Write a function to find the longest common prefix string amongst an array of strings. 官方难度: Easy 翻译: 寻找一个字符串数组的最长公共前缀。 方法一: 方法一的解题代码: 1 private s 阅读全文
摘要:
问题: Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999. 官方难度: Easy 翻译: 将一个范围在1-3999的罗马字符,转化成整数形 阅读全文
摘要:
题目: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 官方难度: Medium 翻译: 给定一个范围在1-3999内的整数,将其转化 阅读全文
摘要:
问题: 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 阅读全文
摘要:
问题: Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding elem 阅读全文
摘要:
问题: Determine whether an integer is a palindrome. Do this without extra space. 官方难度: Easy 翻译: 不使用额外空间,判断一个数是不是回文形式。 解题代码: 1 public static boolean isPa 阅读全文
摘要:
问题: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. 官方难度: Easy 翻译: 实现atoi功能,将一个字符串转化成一个整数。 提示:仔细考 阅读全文