-
### 题目
给定一个字符串 s,找到 s 中最长的回文子串。你可以假设 s 的最大长度为 1000。
示例 1:
输入: "babad"
输出: "bab"
注意: "aba" 也是一个有效答案。
示例 2:
输入: "cbbd"
输出: "bb"
### code
```
class Solution:
def longestPalindrom…
-
**关于字符串匹配**
常用的的字符串匹配算法有BF/RK/KMP等。
BF 算法比较简单,实现思路是,用模式串与主串中是所有⼦串匹 配,看是否有能匹配的⼦串。所以,时间复杂度也⽐较⾼,是 O(n*m),n、m 表示主串和模式串的⻓度。在实际的软件开发中,对于处理⼩规模的字符串匹配很好⽤。
RK 算法是借助哈希算法对 BF 算法进⾏改造,即对每个⼦串分别求哈希值,然后用⼦串的哈希…
-
Modify tor to add a new CLI command `--gen-keypair` (or something to that effect). It will take in a `type` parameter of `x25519` or `ed25519` to either generate v3 hidden service auth keys (`x25519`)…
-
- [x] I have updated Purchases SDK to the latest version
- [x] I have read
the [Contribution Guidelines](https://github.com/RevenueCat/purchases-android/blob/main/CONTRIBUTING.md)
- [x] I have se…
-
`Cannot access 'dev.icerock.moko.parcelize.Parcelable' which is a supertype of 'in.shabinder.soundbound.models.SongModel'. Check your module classpath for missing or conflicting dependencies
`
sha…
-
1. Add --no-install-recommends for apt-get install commands:
adding `--no-install-recommends` for `apt-get install` commands will probably/may reduce the amount of packages installed (then the pack…
-
A recent [paper](https://arxiv.org/pdf/2309.17453.pdf) by Meta/MIT/CMU proposed [StreamingLLM](https://github.com/mit-han-lab/streaming-llm/), a simple yet efficient solution to enable "infinite" cont…
-
Windows + py39 + pip:
```
pip install --no-cache-dir --pre torchcsprng -f https://download.pytorch.org/whl/test/cu111/torch_test.html
```
```
python test_csprng.py -v
test_exponential_kstest (__…
-
I installed Conda with anaconda2 and Windows Subsystem for Linux.
I have strictly followed the steps in instructions, and tried the example named bench_ocrf,py
Here is the error information:
Depre…
-
One big limitation of DMP/KMP right now is that physics interactions are volatile at best.
For example, let's say that **Rover_A** and **Rover_B** are each controlled by separate players. If **Rover_…