摘要:
Given a digit string, return all possible letter combinations that the number could represent. A mapping of digit to letters (just like on the telepho 阅读全文
摘要:
Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. 阅读全文
摘要:
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 of 阅读全文
摘要:
Write a function to find the longest common prefix string amongst an array of strings. 求多个字符串的最长公共前缀。 1、当strs为空,直接输出“” 2、当strs中含有“”,直接输出“” 3、strs[0]的最 阅读全文
摘要:
Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999. 整体来说,罗马数字中的字符代表的数值大小,一般是从左至右非严格递减的(也就是说可能相 阅读全文
摘要:
Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 把十进制转为罗马数 罗马数字的基本符号有I(表示十进制数1),V(表示5),X(表示 阅读全文
摘要:
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 endpo 阅读全文
摘要:
Determine whether an integer is a palindrome. Do this without extra space. 判断一个数是否是回文数。 阅读全文
摘要:
Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
摘要:
Reverse digits of an integer. Example1: x = 123, return 321Example2: x = -123, return -321 注意读入和返回的数都是 int 型的,这时就要考虑反转后这个数会不会超 int,超的话就返回 0 。这时处理数时最好用 阅读全文