- 博客(11)
- 资源 (1)
- 收藏
- 关注
原创 [LeetCode]Largest Sum of Averages@Python
Largest Sum of Averages We partition a row of numbers A into at most K adjacent (non-empty) groups, then our score is the sum of the average of each group. What is the largest score we can achieve? No...
2019-09-26 15:45:17 148
原创 [LeetCode]Minimum Swaps To Make Sequences Increasing@Python
Minimum Swaps To Make Sequences Increasing We have two integer sequences A and B of the same non-zero length. We are allowed to swap elements A[i] and B[i]. Note that both elements are in the same in...
2019-09-25 15:15:31 112
原创 [LeetCode]Min Cost Climbing Stairs@Python
Min Cost Climbing Stairs On a staircase, the i-th step has some non-negative cost cost[i] assigned (0 indexed). Once you pay the cost, you can either climb one or two steps. You need to find minimum c...
2019-09-19 14:08:48 176
原创 [LeetCode]Maximum Length of Repeated Subarray@Python
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 Input: A: [1,2,3,2,1] B: [3,2,1,4,7] Output: 3 Expl...
2019-09-19 13:42:19 70
原创 [LeetCode]Minimum ASCII Delete Sum for Two Strings@Python
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 Input: s1 = “sea”, s2 = “eat” Output: 231 Explana...
2019-09-18 15:55:19 98
原创 [LeetCode]Partition to K Equal Sum Subsets@Python
Partition to K Equal Sum Subsets Given an array of integers nums and a positive integer k, find whether it’s possible to divide this array into k non-empty subsets whose sums are all equal. Example I...
2019-09-17 14:42:32 143
原创 [LeetCode]Knight Probability in Chessboard@Python
Knight Probability in Chessboard On an NxN chessboard, a knight starts at the r-th row and c-th column and attempts to make exactly K moves. The rows and columns are 0 indexed, so the top-left square ...
2019-09-17 10:41:00 99
原创 [LeetCode]Number of Longest Increasing Subsequence@Python
Number of Longest Increasing Subsequence Given an unsorted array of integers, find the number of longest increasing subsequence. Example Input: [1,3,5,4,7] Output: 2 Explanation: The two longest in...
2019-09-12 11:38:06 61
原创 [LeetCode]2 Keys Keyboard@Python
2 Keys Keyboard Initially on a notepad only one character ‘A’ is present. You can perform two operations on this notepad for each step: Copy All: You can copy all the characters present on the notepa...
2019-09-11 15:19:47 74
原创 [LeetCode]Palindromic Substrings@Python
Palindromic Substrings 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 substr...
2019-09-06 15:16:23 100
原创 [Leetcode]Maximum Length of Pair Chain@Python
Maximum Length of Pair Chain You are given n pairs of numbers. In every pair, the first number is always smaller than the second number. Now, we define a pair (c, d) can follow another pair (a, b) if...
2019-09-05 16:39:39 93
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人