Skip to main content

All Questions

Tagged with
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 "...
ela16's user avatar
  • 113
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 ...
Amir Motefaker's user avatar
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 ...
mhay10's user avatar
  • 39
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 ...
mhay10's user avatar
  • 39
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. ...
Akash Patel's user avatar
2 votes
4 answers
984 views

Python palindrome checker function

For practice purposes I implemented a function that checks for palindromes: ...
dicomp's user avatar
  • 41
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 ...
Aviral Srivastava's user avatar
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 ...
Omri Shneor's user avatar
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: ...
Suresh2019's user avatar
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: ...
katty's user avatar
  • 605
-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 ...
KJC2009's user avatar
  • 182
4 votes
1 answer
922 views

Python 3 palindrome checker

I am writing a python3 implementation of palindromes checker. ...
KJC2009's user avatar
  • 182
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 ...
minseong's user avatar
  • 749
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 ...
Aswin Mohan's user avatar
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' ...
Average's user avatar
  • 841

15 30 50 per page