热文leetcode 416. Partition Equal Subset Sum 动态规划DP + 深度优先遍历DFS
Given a non-empty array containing only positive integers, find if the array can be part
Given a non-empty array containing only positive integers, find if the array can be part
654. Maximum Binary Tree ![这里写图片描述][SouthEast] 这道题是中等难度的题目,一开始想到的解法是选择递归,因为这个问题本身就是递
Given two integer arrays A and B, return the maximum length of an subarray that appears
Given a string containing only three types of characters: ‘(‘, ‘)’ and ‘\’, write a func
In English, we have a concept called root, which can be followed by some other words to
We define a harmonious array is an array where the difference between its maximum value
Given two words word1 and word2, find the minimum number of steps required to make word1
Let’s play the minesweeper game (Wikipedia, online game)! You are given a 2D char matri
Given a list of strings, you need to find the longest uncommon subsequence among them. T
Given a group of two strings, you need to find the longest uncommon subsequence of this
Given a string s, find the longest palindromic subsequence’s length in s. You may assume
[原题链接][Link 1] 这个题主要是寻找没有出现的数字。 代码的主要思路是,如果找到数值i,则把对应i-1索引的值取负。 之后遍历列表,如果发现i-1里面的数>
题目: 一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数。任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其和不是
最长公共子序列问题 Time Limit: 1000MS Memory Limit: 65536KB [Submit][] [Statistic][] Proble
1.问题描述: 判断一个正整数是不是回文数。 回文数的定义是,将这个数反转之后,得到的数仍然是同一个数。 2.样例: `11`, `121`, `1`, `
最长公共子序列 ![最长公共子序列][SouthEast] / 最长公共子序列 参考链接:http://blog.csdn.net/bi
> Given an array of integers where 1 ≤ a\[i\] ≤ n (n = size of array), > some elements
1.基本概念 首先需要科普一下,最长公共子序列(longest common sequence)和最长公共子串(longest common substring)不是一回事
问题是什么 这道题和上一道题不一样的地方就是寻找最长的子串,而不是子序列,这是一个典型的动态规划DP问题 代码如下 string a="qwertyuio
问题是什么? 就是求解两个字符串的最长的公共子序列,这是一个经典的DP动态规划问题 代码如下 include <iostream> include
回文数猜想 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others
【[fishing-pan][]:[https://blog.csdn.net/u013921430][https_blog.csdn.net_u013921430]
515:Find Largest Value in Each Tree Row / Definition for a binary tree node. func
在开发高并发系统时,有三把利器来保护系统:缓存、降级和限流。一下有几种限流的方法可以参考。 信号量和令牌桶的区别: 信号量限制的是并发,资源. 令牌桶如果
def fan(str1): len1=len(str1); for i in range(len1): pri