![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
璐璐yao
追梦璐
展开
-
Longest Palindromic Substring
问题描述 (找到字符串中最长的回文子串) Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example 1:Input: “babad” Output: “bab” Note: “aba” is also a...原创 2020-02-23 17:22:31 · 73 阅读 · 0 评论 -
Remove Nth Node From End of List
问题描述: Given a linked list, remove the n-th node from the end of list and return its head. Example:Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end,...原创 2020-02-21 15:28:02 · 117 阅读 · 0 评论 -
Longest Common Prefix
求给定的字符串中共同最长前缀 思想: 1.通过对min()函数找出最短的字符串 2.以最短字符串的长度n为遍历次数,每次遍历列表中所有的字符串 3.每次遍历时,若不满足条件,则将最短字符串减一,再次遍历 4.最后输出最短字符串(可能为具体的字符串,也可能是 “”) 特别用到的函数: str.startswith(string) #判断string是不是str的前缀 min(L,key=len)...原创 2020-02-19 18:43:30 · 101 阅读 · 0 评论