graphdfsbfs 1.clone graph2.copy list with random pointer3.topological sorting4.permutations5.subsets6.n queens7.subsetsII 8.palindrome partitioning9.c ...
分类:
其他好文 时间:
2019-04-10 21:59:36
阅读次数:
154
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Example 2: Example 3: ...
分类:
其他好文 时间:
2019-04-04 09:27:56
阅读次数:
162
上方是测试代码,不能正常使用,需要程序调用palindrome方法,上方未写调用过程,只是简单的演示; JS的正则表达式内容一般用“/ /” 两个正斜杠包含表达式的主体,主体也就是正斜杠后跟的g是修饰符(可不写)。当前为g表示执行全局匹配(查找所有匹配而非在找到第一个匹配后停止);若为i则表示执行对 ...
分类:
Web程序 时间:
2019-04-02 12:36:25
阅读次数:
196
到题目链接:http://codeforces.com/contest/1140/problem/E 题目大意: 如果一个数组的存在一个奇数长的回文就不好。 不是不好的数组是好的。 你可以把-1用1到k中一个数替换。问可以有多少种不同的好数组。 开虚拟赛最后一分钟把它A了,很开心,很开心。 思路: ...
分类:
其他好文 时间:
2019-03-29 14:47:35
阅读次数:
174
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 ...
分类:
其他好文 时间:
2019-03-29 13:05:49
阅读次数:
107
这里重点介绍NIO 待定 http://www.apigo.cn/2018/11/09/javacore5/ https://juejin.im/entry/598da7d16fb9a03c42431ed3 https://mp.weixin.qq.com/s/c9tkrokcDQR375kiwCe ...
分类:
其他好文 时间:
2019-03-27 14:18:33
阅读次数:
136
sa[i]表示排名为 i 的后缀的第一个字符在原串中的位置 height[i]表示排名为 i 和排名为 i+1的后缀的最长公共前缀的长度 这些题目我并不一定全是用SA做的,但是还是要标记一下的 K - Extend to Palindrome Your task is, given an integ ...
分类:
编程语言 时间:
2019-03-25 21:55:00
阅读次数:
174
一、组合 组合指的是某一个对象拥有一个属性,该属性的值是另外一个类的对象 class Foo: pass class Bar: pass obj = Foo() obj.attr = Bar() 使用组合也是为了减少代码冗余 如何使用组合 class OldboyPeople: school = ' ...
分类:
其他好文 时间:
2019-03-20 01:00:26
阅读次数:
140
Given a singly linked list, determine if it is a palindrome. Example 1: Example 2: 题目要求:以 O(1) 的空间复杂度来求解。 切成两半,把后半段反转,然后比较两半是否相等。 时间复杂度:o(n) 空间复杂度:o(1 ...
分类:
其他好文 时间:
2019-03-19 23:27:42
阅读次数:
262