All Questions
Tagged with palindrome python-3.x
22
questions
1
vote
2
answers
160
views
Making my DP algorithm faster - longest palindromic substring
The following code is my solution to a LeetCode question - find the longest palindromic substring. My code is 100% correct, it passed once but it took too long, and in most of the reruns I hit a "...
3
votes
3
answers
1k
views
The largest palindrome made from the product of two 3-digit numbers
Problem description:
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made from the ...
1
vote
1
answer
225
views
Find next biggest palindrome
I have written a program for the SPOJ PALIN problem:
A positive integer is called a palindrome if its[decimal representation is the same]from left to right and from right to left. For a given ...
1
vote
1
answer
362
views
Finding the next palindrome number
I wrote a piece of code that generates the next palindromic number and that works fine. However I feel like my code isn't as efficient as it could be. Are there any tweaks that I could implement to ...
0
votes
1
answer
95
views
Algorithm For Longest Palindrome
I made an brute force algorithm to find the longest palindrome within the string. This palindrome is a substring of the input. Below is the code.
...
2
votes
4
answers
984
views
Python palindrome checker function
For practice purposes I implemented a function that checks for palindromes:
...
1
vote
0
answers
126
views
How do I optimize memoization in order to find longest palindromic substring?
I want to find the longest palindromic substring using dynamic programming in Python3. The strings can be as large as this string.
I have seen other questions on this problem that successfully solve ...
3
votes
1
answer
271
views
Project Euler - Problem No.4 - Largest palindrome product
according to the problem:
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest palindrome made ...
1
vote
1
answer
189
views
Check if given integer is a palindrome
This code checks if the given integer is a palindrome. If it is, prints given integer is a palindrome else, not a palindrome:
...
7
votes
2
answers
2k
views
Counting the number of continuous palindromic substrings
Given a string of lowercase ASCII characters, find all distinct continuous palindromic sub-strings of it.
Here is my code:
...
-3
votes
1
answer
516
views
My third post about Python 3 palindromes
I'm new to python3, and I tried to test if my palindrome codes work and pass most of the edge cases. so I created the following 2 python files below. When I ran the ...
4
votes
1
answer
922
views
Python 3 palindrome checker
I am writing a python3 implementation of palindromes checker.
...
6
votes
2
answers
766
views
Counting ways to divide a word into palindrome blocks
I wrote this program as a solution to the 2015 British Informatics Olympiad question on "block" palindromes.
Brief overview of the task:
A palindrome is a word that shows the same sequence ...
1
vote
1
answer
671
views
Project Euler #4 - Largest Palindrome Project - Python
I solved the HackerRank version of the Largest palindrome problem (similar to Project Euler 4) in Python:
Find the largest palindrome made from the product of two 3-digit numbers which is less than ...
4
votes
2
answers
5k
views
Check if a string is a permutation of a palindrome using Python
This is a solution to exercise 1.4 from Cracking the Coding Interview written using Python 3.
Given a string, write a function to check if it is a permutation of a palindrome.
Example: 'Tact Coa'
...