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 | 345 Views, 16607 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 | 345 Views, 16607 Search Bots | 69 Words Subscribe to Feed Burner

Related Articles

  1. Number of Ways to Climb Stairs
  2. A trick for getting good at coding interviews FASTER
  3. Daily Interview Problem: First Missing Positive Integer
  4. Daily Interview Problem: Find the k-th Largest Element in a List
  5. Daily Interview Problem: Merge List Of Number Into Ranges
  6. PHP Unit Tests on VPS Server
  7. Daily Interview Question: Longest Sequence with Two Unique Numbers
  8. Daily Interview Problem: Circle of Chained Words
  9. CVE-2015-8874 - cPanel EasyApache Vulnerabilities
  10. Absolute Path

Comments (0)

    Be the first one to comment this page !


Page Edited: May 11 2024 14:36:49 | RSS Subscription
How to Cook a Perfect Steak? | <meta name="robots" content="noindex, follow" />