LeetCode题解
7-sevens
跑马拉松的程序员
展开
-
LeetCode-11:Container With Most Water
Container With Most Water. 盛最多水的容器.一、题目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 endpoints of li...原创 2019-10-18 15:13:35 · 117 阅读 · 0 评论 -
LeetCode-10:Regular Expression Matching
Regular Expression Matching. 正则表达式匹配.一、题目Given an input string (s) and a pattern §, implement regular expression matching with support for ‘.’ and ‘*’‘.’ Matches any single character.‘*’ Matches ...原创 2019-10-16 16:22:02 · 128 阅读 · 0 评论 -
LeetCode-9:Palindrome Number
Palindrome Number. 回文数.一、题目Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward.Example 1:Input: 121Output: trueExample 2:Input...原创 2019-09-28 23:53:09 · 245 阅读 · 0 评论 -
LeetCode-5:Longest Palindromic Substring
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 1: Input: “babad” ...原创 2018-07-14 00:00:08 · 144 阅读 · 0 评论 -
LeetCode-8:String to Integer (atoi)
String to Integer (atoi). 字符串转整数 (atoi).一、题目Implement atoi which converts a string to an integer.The function first discards as many whitespace characters as necessary until the first non-whit...原创 2018-07-19 00:08:53 · 182 阅读 · 0 评论 -
LeetCode-7:Reverse Integer
Reverse Integer. 反转整数.一、题目Given a 32-bit signed integer, reverse digits of an integer.Example 1: Input: 123 Output: 321Example 2: Input: -123 Output: -321Example 3: ...原创 2018-07-18 00:06:06 · 250 阅读 · 0 评论 -
LeetCode-6:ZigZag Conversion.
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 1: Input: “babad” Ou...原创 2018-07-17 23:58:35 · 168 阅读 · 0 评论 -
LeetCode-2:Add Two Numbers
一、题目原题链接:https://leetcode.com/problems/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 ...原创 2018-04-06 17:17:04 · 149 阅读 · 0 评论 -
LeetCode-4:Median of Two Sorted Arrays
一、题目原题链接:https://leetcode.com/problems/median-of-two-sorted-arrays/description/ 难度等级:困难There are two sorted arrays nums1 and nums2 of size m and n respectively.Find the median of the two sorted...原创 2018-04-08 23:05:48 · 148 阅读 · 0 评论 -
LeetCode-3:Longest Substring Without Repeating Characters
一、题目原题链接:https://leetcode.com/problems/longest-substring-without-repeating-characters/ 难度等级:中等Given a string, find the length of the longest substring without repeating characters.Examples: Gi...原创 2018-04-07 23:47:28 · 162 阅读 · 0 评论