摘要: 题目链接:https://leetcode.com/problems/shortest-palindrome/ 题意:已知一个字符串s,在其前面添加最少的字符数使其成为一个回文串。 思路:设字符串s的长度为len,则最多肯定是添加len长度的字符,即将s倒置。什么情况可以少添加字符呢?当s的前缀是一 阅读全文
posted @ 2019-08-30 19:40 dlutjwh 阅读(131) 评论(0) 推荐(0) 编辑