JinFei's Blog

Thinking will not overcome fear but action will.

[LeetCode]171. Excel Sheet Column Number

26进制转10禁止

题目描述 Given a column title as appear in an Excel sheet, return its corresponding column number. For example: A -> 1 B -> 2 C -> 3 ... Z -> 26 AA -> 27 ...

[LeetCode]66. Plus One

加1操作

题目描述 Given a non-empty array of digits representing a non-negative integer, plus one to the integer. The digits are stored such that the most significant digit is at the head of the list, and ...

[LeetCode]Pascal's Triangle

图形输出

题目描述 Given a non-negative integer numRows, generate the first numRows of Pascal’s triangle. In Pascal’s triangle, each number is the sum of the two numbers directly above it. Example1: ...

[LeetCode]76. Minimum Window Substring

最小的子串窗口

题目描述 Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n). Example1: Input: S = "ADOBECODEBANC", T = "ABC" Outp...

[LeetCode]45. Jump Game II

最少的步数

题目描述 Given an array of non-negative integers, you are initially positioned at the first index of the array. Each element in the array represents your maximum jump length at that position. You...

[LeetCode]32. Longest Valid Parentheses

最长有效字符

题目描述 Given a string containing just the characters ‘(‘ and ‘)’, find the length of the longest valid (well-formed) parentheses substring. Example1: Input: "(()" Output: 2 Explana...

[LeetCode]41. First Missing Positive

第一个丢失的正整数

题目描述 Given an unsorted integer array, find the smallest missing positive integer. Example1: Input: [1,2,0] Output: 3 Example 2: Input: [3,4,-1,1] Output: 2 Example 3: ...

[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. Example1: Input: A: [1,2,3,2,1] B: [3,2,1,4,7] Output: 3 Expl...

[LeetCode]85. Maximal Rectangle

递增栈

题目描述 Given a 2D binary matrix filled with 0’s and 1’s, find the largest rectangle containing only 1’s and return its area. Example1: Input: [ ["1","0","1","0","0"], ["1",...

[LeetCode]239. Sliding Window Maximum

滑动窗口,multiset使用

题目描述 Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sli...