
Leetcode
沙漏dan
我感受到的压力都是来自于我自己不努力不积极而又不甘于现状的恐慌
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
LeetCode 两数之和 Python
参考:1. 两数之和-Python-LeetCode 给定一个整数数组和一个目标值,找出数组中和为目标值的两个数。 你可以假设每个输入只对应一种答案,且同样的元素不能被重复利用。 示例: 给定 nums = [2, 7, 11, 15], target = 9 因为 nums[0] + nums[1] = 2 + 7 = 9 所以返回 [0, 1] 解法一: class So...转载 2018-08-04 20:19:20 · 287 阅读 · 0 评论 -
Leetcode 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 for better legibility) P A H N A P L ...原创 2018-08-12 11:44:46 · 195 阅读 · 0 评论 -
Leetcode 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 line i is a...转载 2018-08-14 19:24:38 · 192 阅读 · 0 评论 -
Leetcode Regular Expression Matching
题目: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...转载 2018-08-14 19:06:52 · 203 阅读 · 0 评论 -
Leetcode 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: 121 Output: true Example 2: Input: -...转载 2018-08-14 18:44:57 · 168 阅读 · 0 评论 -
Leetcode String to Integer (atoi)
题目:String to Integer (atoi) Implement atoi which converts a string to an integer. The function first discards as many whitespace characters as necessary until the first non-whitespace character is f...转载 2018-08-14 17:04:25 · 189 阅读 · 0 评论 -
LeetCode 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" Output: "bab" Note: "aba" is also a valid answer. Exam...原创 2018-08-05 18:12:08 · 193 阅读 · 0 评论 -
LeetCode 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 (m+n)). You may assume nums1 and n...原创 2018-08-05 16:13:48 · 123 阅读 · 0 评论 -
LeetCode 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 is 3. Given "bbbbb", the answer is "b", with...转载 2018-08-05 15:58:05 · 122 阅读 · 0 评论 -
LeetCode Add Two Numbers
[LeetCode] 2. Add Two Numbers 两数相加 @python 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 ...转载 2018-08-04 22:44:02 · 249 阅读 · 0 评论 -
Leetcode 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 Note: Assume we ar...原创 2018-08-12 17:49:21 · 171 阅读 · 0 评论