To the Top
File:  root - text - article - 2019 - 10 - daily-problem-twitter-palindrome.txt
Tags: 每日算法, 回文数, 面试, Python, daily problem, palindrome, algorithms, twitter interview question, python, | English | Home Page | Category: Computing | 283 Views, 14796 Search Bots | 69 Words

Subscribe to Feed Burner | Browse | Archive
Hi, here's your problem today. This problem was recently asked by Twitter:

A palindrome is a sequence of characters that reads the same backwards and forwards. Given a string, s, find the longest palindromic substring in s.

Example:
Input: "banana"
Output: "anana"

Input: "million"
Output: "illi"


class Solution:
def longestPalindrome(self, s):
# Fill this in.

# Test program
s = "tracecars"
print(str(Solution().longestPalindrome(s)))
# racecar
Tags: 每日算法, 回文数, 面试, Python, daily problem, palindrome, algorithms, twitter interview question, python, | English | Home Page | Cateogry: Computing | 283 Views, 14796 Search Bots | 69 Words Subscribe to Feed Burner

Related Articles

  1. Algorithm Interview: Maximum Path Sum in Binary Tree
  2. Daily Interview Problem: Min Stack
  3. Floor and Ceiling of a Binary Search Tree
  4. Daily Interview Puzzle: Intersection of Linked Lists
  5. Daily Interview Puzzle: Falling Dominoes
  6. Daily Interview Problem: Merge List Of Number Into Ranges
  7. Daily Interview Puzzle: Ways to Traverse a Grid
  8. Daily Interview Problem: Sort Colors
  9. Daily Interview Problem: First Missing Positive Integer
  10. Daily Interview Problem: Merge K Sorted Linked Lists

Comments (0)

Your Email (Domain Part Not Exposed):

Your Comments:

Privately By Mail Colors More Smileys S x y @

Verification (Click Image 2 Refresh):

    Be the first one to comment this page !


Page Edited: October 30 2020 14:21:09 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />