摘要: LeetCode 424. Longest Repeating Character Replacement Given a string that consists of only uppercase English letters, you can replace any letter in th阅读全文
posted @ 2019-04-13 03:48 lz87 阅读(22) 评论(0) 编辑
摘要: Given a set of closed intervals, find the smallest set of numbers that covers all the intervals. If there are multiple smallest sets, return any of th阅读全文
posted @ 2019-03-30 01:42 lz87 阅读(35) 评论(0) 编辑
摘要: Given a string which we can delete at most k, return whether you can make a palindrome. For example, given 'waterrfetawx' and a k of 2, you could dele阅读全文
posted @ 2019-03-29 12:31 lz87 阅读(14) 评论(0) 编辑
摘要: Graph: n nodes, m edges Representation Adjacency Matrix: O(n^2) space, not efficient for sparse graph Adjacency List: O(n + m) space, efficient for sp阅读全文
posted @ 2019-03-08 12:27 lz87 阅读(23) 评论(0) 编辑
摘要: There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists of merging exactly K consecutive piles into one pil阅读全文
posted @ 2019-03-04 07:49 lz87 阅读(222) 评论(0) 编辑
摘要: Given an array A of 0s and 1s, we may change up to K values from 0 to 1. Return the length of the longest (contiguous) subarray that contains only 1s.阅读全文
posted @ 2019-03-04 00:33 lz87 阅读(93) 评论(0) 编辑
摘要: We are given that the string "abc" is valid. From any valid string V, we may split V into two pieces X and Y such that X + Y (X concatenated with Y) i阅读全文
posted @ 2019-03-04 00:14 lz87 阅读(93) 评论(0) 编辑
摘要: Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Example 1: Example 2: 阅读全文
posted @ 2019-03-02 13:20 lz87 阅读(11) 评论(0) 编辑
摘要: Given an array of integers A, find the sum of min(B), where B ranges over every (contiguous) subarray of A. Since the answer may be large, return the 阅读全文
posted @ 2019-03-02 00:51 lz87 阅读(130) 评论(0) 编辑
摘要: On a N x N grid of cells, each cell (x, y) with 0 <= x < N and 0 <= y < N has a lamp. Initially, some number of lamps are on. lamps[i] tells us the lo阅读全文
posted @ 2019-02-26 12:38 lz87 阅读(130) 评论(0) 编辑