2018年3月31日

018 4Sum 四个数的和

摘要: 给定一个含有 n 个整数的数组 S,数列 S 中是否存在元素 a,b,c 和 d 使 a + b + c + d = target ?请在数组中找出所有满足各元素相加等于特定值的不重复组合。注意:解决方案集不能包含重复的四元组合。例如,给定数组 S = [1, 0, -1, 0, -2, 2],并且 阅读全文

posted @ 2018-03-31 23:48 lina2014 阅读(121) 评论(0) 推荐(0) 编辑

017 Letter Combinations of a Phone Number 电话号码的字母组合

摘要: 给定一个数字字符串,返回数字所有可能表示的字母组合。 输入:数字字符串 "23"输出:["ad", "ae", "af", "bd", "be", "bf", "cd", "ce", "cf"]. 详见:https://leetcode.com/problems/letter-combination 阅读全文

posted @ 2018-03-31 22:20 lina2014 阅读(142) 评论(0) 推荐(0) 编辑

014 Longest Common Prefix 查找字符串数组中最长的公共前缀字符串

摘要: 编写一个函数来查找字符串数组中最长的公共前缀字符串。 详见:https://leetcode.com/problems/longest-common-prefix/description/ 实现语言:Java 参考:https://www.cnblogs.com/grandyang/p/460692 阅读全文

posted @ 2018-03-31 22:16 lina2014 阅读(189) 评论(0) 推荐(0) 编辑

013 Roman to Integer 罗马数字转整数

摘要: 给定一个罗马数字,将其转换成整数。 返回的结果要求在 1 到 3999 的范围内。 详见:https://leetcode.com/problems/roman-to-integer/description/ class Solution { public: int romanToInt(strin 阅读全文

posted @ 2018-03-31 21:34 lina2014 阅读(140) 评论(0) 推荐(0) 编辑

012 Integer to Roman 整数转换成罗马数字

摘要: 给定一个整数,将其转为罗马数字。输入保证在 1 到 3999 之间。 详见:https://leetcode.com/problems/integer-to-roman/description/ class Solution { public: string intToRoman(int num) 阅读全文

posted @ 2018-03-31 17:54 lina2014 阅读(138) 评论(0) 推荐(0) 编辑

011 Container With Most Water 盛最多水的容器

摘要: 给定 n 个非负整数 a1,a2,…,an,每个数代表坐标中的一个点 (i, ai) 。画 n 条垂直线,使得垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0)。找出其中的两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。 详见:https://leetcode.com/prob 阅读全文

posted @ 2018-03-31 17:32 lina2014 阅读(256) 评论(0) 推荐(0) 编辑

010 Regular Expression Matching 正则表达式匹配

摘要: Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding element. 阅读全文

posted @ 2018-03-31 16:36 lina2014 阅读(80) 评论(0) 推荐(0) 编辑

007 Reverse Integer 旋转整数

摘要: Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output 阅读全文

posted @ 2018-03-31 14:33 lina2014 阅读(104) 评论(0) 推荐(0) 编辑

006 ZigZag Conversion

摘要: The string "PAYPALISHIRING" is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font 阅读全文

posted @ 2018-03-31 13:50 lina2014 阅读(132) 评论(0) 推荐(0) 编辑

005 Longest Palindromic Substring 最长回文子串

摘要: Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.Example:Input: "babad"Output: "bab" 阅读全文

posted @ 2018-03-31 11:54 lina2014 阅读(130) 评论(0) 推荐(0) 编辑

003 Longest Substring Without Repeating Characters 最长不重复子串

摘要: Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length 阅读全文

posted @ 2018-03-31 11:52 lina2014 阅读(139) 评论(0) 推荐(0) 编辑

002 Add Two Numbers 链表上的两数相加

摘要: You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contai 阅读全文

posted @ 2018-03-31 11:50 lina2014 阅读(149) 评论(0) 推荐(0) 编辑

导航