
LeetCode
程序员啊粥
比你优秀的人比你还努力,你有什么资格不去奋斗!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
【LeetCode题解---1】Two Sum.md
【LeetCode题解—1】Two Sum 题目 Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, an...原创 2018-09-25 18:22:19 · 521 阅读 · 0 评论 -
【LeetCode - 016】最接近的三数之和
最接近的三数之和 题目 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. You may assume that each input would ...转载 2018-12-01 20:31:18 · 227 阅读 · 0 评论 -
【LeetCode - 015】三数之和
三数之和 题目 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 zero. Note: Elements in a triplet (a,b...原创 2018-12-01 20:29:22 · 227 阅读 · 0 评论 -
【LeetCode-012】Integer to Roman
题目 Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D ...原创 2018-11-07 23:55:28 · 145 阅读 · 0 评论 -
【011】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 line i is at (i, ai) and (i, 0). Find tw...原创 2018-11-03 21:48:02 · 200 阅读 · 0 评论 -
【010】Regular Expression Matching
题目 Given an input string (s) and a pattern (p), implement regular expression matching with support for '.' and '*'. '.' Matches any single character. '*' Matches zero or more of the preceding element....原创 2018-11-03 21:31:36 · 268 阅读 · 0 评论 -
【191】Number of 1 bits
题目 Write a function that takes an unsigned integer and returns the number of ‘1’ bits it has (also known as the Hamming weight). Example 1: Input: 11 Output: 3 Explanation: Integer 11 has binary repre...原创 2018-10-21 09:57:30 · 230 阅读 · 0 评论 -
LeetCode【009】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: 121 Output: true Example 2: Input: -121 Output: false Explana...原创 2018-10-25 16:52:40 · 206 阅读 · 0 评论 -
【LeetCode 006】Zigzag Conversion.md
题目 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 for better legibility) P A H N A P L S I ...原创 2018-10-08 21:06:19 · 274 阅读 · 0 评论 -
【004】Median of Two Sorted Arrays.md
【004】Median of Two Sorted Arrays 题目 There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log ...原创 2018-09-28 14:57:43 · 197 阅读 · 0 评论 -
【LeetCode题解-005】longest Palindrome 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" Output: "bab" Note: "aba" is also a valid answer. Exam...原创 2018-10-13 11:23:16 · 525 阅读 · 0 评论 -
【LeetCode题解---003】Longest Substring Without Repeating Characters
题目 Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb" Output: 3 Explanation: The answer is "abc", with the length of 3. Example 2: I...原创 2018-09-26 15:52:12 · 277 阅读 · 0 评论 -
【LeetCode题解---007】 Reverse Integer
今天的题目很简单,毕竟大过节的,也不能太放肆,太难为自己 题目 Given a 32-bit signed integer, reverse digits of an integer. Example 1: Input: 123 Output: 321 Example 2: Input: -123 Output: -321 Example 3: Input: 120 Output: 21 N...原创 2018-10-02 19:27:25 · 241 阅读 · 0 评论 -
【LeetCode题解---2】Add Two Numbers.md
【LeetCode题解—2】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 contain a single dig...原创 2018-09-25 18:37:38 · 280 阅读 · 0 评论 -
【LeetCode题解---771】Jewels and Stones.md
【LeetCode题解—771】Jewels and Stones 题目 You’re given strings J representing the types of stones that are jewels, and S representing the stones you have. Each character in S is a type of stone you have....原创 2018-09-25 18:24:25 · 270 阅读 · 0 评论 -
【LeetCode - 018】四数之和
四数之和 题目 Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: Elements ...原创 2018-12-01 20:53:36 · 245 阅读 · 0 评论