.NET C#
talione
这个作者很懒,什么都没留下…
展开
-
Longest Valid Parentheses
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring.Example 1:Input: "(()"Output: 2Explanation: The longest valid...翻译 2020-04-17 11:47:09 · 81 阅读 · 0 评论 -
Next Permutation
Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible o...原创 2020-04-16 22:42:37 · 151 阅读 · 0 评论 -
动态规划——不等式
已知数列a={1,2,3,...,n},将k个小于符号('<')和n-k-1个大于符号('>')插入数列中可以使其构成一个合法的不等式(0<=k<=n-1)。例如a={1,2},可以为1<2或2>1;a={1,2,3},可以为1<2<3、1<3>2、2>1<3、2<3>1、3>1<2、3>2>...原创 2020-04-16 17:06:16 · 392 阅读 · 0 评论 -
最短路径算法
坐标轴上有N点,跳过其中一点后求距离的最小值:a. 路径从0到N依次连接;b. 固定起始点a[0]=(0,0)和终点a[n]=(100,100);c. 假设三个点a、b、c,从a到c经过b,距离为ab+bc,跳过b后距离为ac;d. 为简化算法,所有点坐标皆为整数。double[,] a = new double[,] { { 0, 0 }, { 1, 2 }, { 3,...原创 2020-04-16 14:45:59 · 317 阅读 · 0 评论