All Questions
Tagged with palindrome algorithm
52
questions
7
votes
3
answers
187
views
Euler - Largest Palindrome Product in Java
Having been going over the documentation, learning more of the subtleties of Java. I am now going over some basic Project-Euler solution code I wrote a little while back. Hoping I can pick up some ...
1
vote
1
answer
66
views
isPalindrom-function in TypeScript
I have written an isPalindrom-Function in TypeScript.
...
0
votes
1
answer
38
views
Is my approach for Palindrome right or is there a better way to do it?
The code below is for checking whether the input string is palindrome or not
...
1
vote
1
answer
115
views
Manacher Algorithm in Haskell
Please review the manacher algorithm in haskell. Find the longest Palindrome in a String.
...
1
vote
2
answers
260
views
Find largest palindromic substrings in a string
I have written some code to find the largest palindromic sub-strings in a string without repeating any character.
Example input
abappabaxhhh
output
...
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.
...
3
votes
1
answer
696
views
Optimizing code solution for Palindrome Index-Hackerrank
I submitted my solution for palindrome Index coding challenge but I get "test cases terminated due to time out error". My code is working and so I don't know what else to do to optimize it. Please ...
3
votes
0
answers
2k
views
HackerRank's Challenging Palindromes solution times out for certain tests
I am trying to solve the Challenging Palindromes problem from HackerRank. The code that I have got so far fails only for large inputs due to timeout, every other test it passes successfully.
The ...
3
votes
1
answer
83
views
A fast generator of palindrome dates in chronological order
02/02/2020 is a palindrome day because reading the date left-to-right or right-to-left still refers to the same calendar date. And because it doesn't
matter whether you use the DD/MM/YYYY format or ...
3
votes
1
answer
381
views
Palindromic partitions solution
Task
Find the smallest number of cuts required to break a string into a set of valid palindromes.
For example:
ababbbabbababa becomes a|babbbab|b|ababa (cuts = 3)
partytrapb becomes partytrap|b (...
1
vote
1
answer
237
views
Palindrome Pairs
The task
is taken from leetcode
Given a list of unique words, find all pairs of distinct indices (i,
j) in the given list, so that the concatenation of the two words, i.e.
words[i] + words[j] ...
6
votes
3
answers
2k
views
Determine whether an integer is a palindrome
The task
Determine whether an integer is a palindrome. An integer is a
palindrome when it reads the same backward as forward.
Example 1:
Input: 121 Output: true
Example 2:
...
4
votes
1
answer
231
views
Return whether a string is a palindrome if you can delete at most k elements
The task:
Given a string which we can delete at most k, return whether you can
make a palindrome.
For example, given 'waterrfetawx' and a k of 2, you could delete f and
x to get '...
11
votes
5
answers
1k
views
Easy to read palindrome checker
I made a palindrome checker that's supposed to be designed to be simple and easy to read. Please let me know what you think. I believe the time complexity is \$\mathcal{O}(n)\$ but I'm not too sure ...
4
votes
2
answers
499
views
Longest Palindromic Substring better approach
I have encountered to this question and applied a brute force algorithm off top of my head and couldn't find a better optimized solution.
I was hoping I could get some insight to implement a better ...