![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
leetcode
有书就看
这个作者很懒,什么都没留下…
展开
-
718. Maximum Length of Repeated Subarray
Given two integer arrays A and B, return the maximum length of an subarray that appears in both arrays.Example 1:Input:A: [1,2,3,2,1]B: [3,2,1,4,7]Output: 3Explanation: The repeated subarray...原创 2018-01-24 15:15:06 · 205 阅读 · 0 评论 -
908.Smallest Range I
Given an array A of integers, for each integer A[i] we may choose any x with -K <= x <= K, and add x to A[i].After this process, we have some array B.Return the smallest possible difference ...原创 2018-11-07 20:11:04 · 178 阅读 · 0 评论 -
929. Unique Email Address
If you add a plus ('+') in the local name, everything after the first plus sign will be ignored. This allows certain emails to be filtered, for example m.y+name@email.com will be forwarded to my@email...原创 2018-11-07 19:46:34 · 522 阅读 · 0 评论 -
922. Sort Array By Partity II
Given an array A of non-negative integers, half of the integers in A are odd, and half of the integers are even.Sort the array so that whenever A[i] is odd, i is odd; and whenever A[i] is even, i is...原创 2018-11-02 10:41:38 · 187 阅读 · 0 评论 -
852.Peak Index in a Mountain Array
Let's call an array A a mountain if the following properties hold:A.length >= 3 There exists some 0 < i < A.length - 1 such that A[0] < A[1] < ... A[i-1] < A[i] > A[i+1] > ....原创 2018-11-02 09:11:58 · 164 阅读 · 0 评论 -
728. Self-Dividing-Numbers
A self-dividing number is a number that is divisible by every digit it contains.For example, 128 is a self-dividing number because 128 % 1 == 0, 128 % 2 == 0, and 128 % 8 == 0.Also, a self-dividin...原创 2018-11-01 21:19:42 · 172 阅读 · 0 评论 -
709. To Lower Case
Implement function ToLowerCase() that has a string parameter str, and returns the same string in lowercase. Example 1:Input: "Hello"Output: "hello"Example 2:Input: "here"Output: "here"...原创 2018-10-29 15:21:19 · 159 阅读 · 0 评论 -
136. Single Number
Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without us...原创 2018-10-26 13:45:24 · 116 阅读 · 0 评论 -
7. 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: 21Note:Assume we are dea...原创 2018-10-25 19:43:11 · 116 阅读 · 0 评论 -
647. Palindromic Substrings
Problem description: Given a string, your task is to count how many palindromic substrings in this string.The substrings with different start indexes or end indexes are counted as different substrin...原创 2018-01-18 08:45:58 · 218 阅读 · 0 评论 -
413. Arithmetic Slices
A sequence of number is called arithmetic if it consists of at least three elements and if the difference between any two consecutive elements is the same.For example, these are arithmetic sequence:...原创 2018-01-18 09:05:43 · 191 阅读 · 0 评论 -
712. Minimum ASCII Delete Sum for Two Strings
Given two strings s1, s2, find the lowest ASCII sum of deleted characters to make two strings equal.Example 1:Input: s1 = "sea", s2 = "eat"Output: 231Explanation: Deleting "s" from "sea" adds t...原创 2018-01-20 21:23:16 · 176 阅读 · 0 评论 -
72. Edit Distance
Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)You have the following 3 operations permitted on a word:...原创 2018-01-22 14:47:04 · 301 阅读 · 0 评论 -
942. DI String Match
Given a string S that only contains "I" (increase) or "D" (decrease), let N = S.length.Return any permutation A of [0, 1, ..., N] such that for all i = 0, ..., N-1:If S[i] == "I", then A[i] < A...原创 2018-11-27 10:11:40 · 439 阅读 · 0 评论