link to problem Description: Given two strings text1 and text2, return the length of their longest common subsequence. A subsequence of a string is a ...
分类:
其他好文 时间:
2020-01-06 09:54:55
阅读次数:
84
/** * 687. Longest Univalue Path(最长的相同值路经) * https://leetcode.com/problems/longest-univalue-path/description/ * https://www.youtube.com/watch?v=yX1hVh ...
分类:
其他好文 时间:
2020-01-06 09:45:35
阅读次数:
79
题目大意:给定一棵树,每条边都有对应的权值,在树上找一条简单的路径,使得所有边权值的异或值最大。 分析:这个类似于前边写过的一个数组选定两个数的最大异或值,先dfs预处理一下从1到i的异或值D[i],然后当你想要取到s到e的异或值就是D[s]^D[e]。接下来就相当于之前写过的两个数的最大异或值问题 ...
分类:
其他好文 时间:
2020-01-05 18:45:16
阅读次数:
56
Given a binary tree, find the length of the longest consecutive sequence path. The path refers to any sequence of nodes from some starting node to any ...
分类:
其他好文 时间:
2020-01-05 11:56:36
阅读次数:
74
C#中的近似字符串比较 该项目中包含的算法 海明距离| https://baike.baidu.com/item/%E6%B5%B7%E6%98%8E%E8%B7%9D%E7%A6%BB/4235876?fr=aladdin 提卡距离| http://en.wikipedia.org/wiki/Ja ...
分类:
其他好文 时间:
2020-01-03 14:00:46
阅读次数:
94
#include<stdio.h> #include<iostream> #include<vector> #include<string> using namespace std; int f[1010][1010] = {0}; int main() { string s; getline(ci ...
分类:
其他好文 时间:
2019-12-30 23:15:03
阅读次数:
105
Given a string, find the length of the longest substring without repeating characters. Example 1: Input: "abcabcbb"Output: 3 Explanation: The answer i ...
分类:
其他好文 时间:
2019-12-30 09:34:59
阅读次数:
59
题目描述:给一个二叉树,返回该二叉树的最大深度 Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root nod ...
分类:
其他好文 时间:
2019-12-30 09:21:14
阅读次数:
77
原题链接在这里:https://leetcode.com/problems/longest-absolute-file-path/ 题目: Suppose we abstract our file system by a string in the following manner: The str ...
分类:
其他好文 时间:
2019-12-27 09:20:20
阅读次数:
60
3. Longest Substring Without Repeating Characters Medium 7205424Add to ListShare Given a string, find the length of the longest substring without repe ...
分类:
其他好文 时间:
2019-12-25 12:53:25
阅读次数:
75