All Questions
Tagged with palindrome complexity
7
questions
3
votes
2
answers
544
views
One Piece Treasure- Find the number of palindromic substrings in a large substring
I'm trying to solve the below question:
A string of characters X (all in lowercase) of length n is present. We can ask a query <...
4
votes
2
answers
2k
views
Next palindromic number
I wrote a function that takes a number and finds the next palindromic number. Time complexity is currently O(n2), which is really bad. How could one make this function more efficient?
...
0
votes
1
answer
95
views
Finding time complexity of my solution to the 'longest palindrome' problem in Python
Here is a short version!
...
3
votes
1
answer
49
views
Complexity for two approaches of finding next biggest palindrome of a number
I have come up with a problem online about the next biggest palindrome of a number and i have solved the problem by two different approaches in python. The first one is,
...
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'
...
3
votes
1
answer
3k
views
Faster palindrome checker in Java
I wonder if there could be a faster palindrome checker in Java. The best one I have is O(n/2) which is O(n) eventually:
...
4
votes
1
answer
183
views
Worst case runtime analysis of a string partitioning algorithm
Give all the partitionings of a string s such that every substring of the partition is a
palindrome
What is the time complexity of this solution? And, how can I improve my code overall?
...