Questions tagged [palindrome]
Any sequence of units (typically letters or numbers) that are read the same way forward or backward.
261 questions
5
votes
3
answers
149
views
Ruby: Check for Palindrome (as Monkey-Patch on String-class)
I have written a method, which checks for Palindrome and attached it to the String-class.
Here's the code:
...
7
votes
3
answers
240
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 ...
13
votes
10
answers
8k
views
Tests for palindromes in C and C++
A question I've been asked on interactive phone screens is to code a test to determine whether a string is
a palindrome or not. I am providing two examples here: one in C and one in C++. They both ...
8
votes
5
answers
3k
views
Palindrome checker program
I've been studying Java for some days and I'm just now starting to make some simple programs, I'd like to know if there's any 'noob' mistakes or habits that I could avoid.
In other words: how could ...
5
votes
1
answer
331
views
LeetCode: Longest Palindromic Substring
Problem Statement
Given a string s , return the longest palindromic substring in s.
Constraints
...
5
votes
7
answers
3k
views
Determine if a word is a palindrome
I'm a newbie programmer and was given a task to find if the input word is a palindrome or not. Now, I've written the program to the best of my ability but would like to know how it could be improved.
...
3
votes
2
answers
602
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 <...
3
votes
2
answers
103
views
Palindrome predicate
A standard beginner problem is to determine whether a particular input is palindromic, i.e. reads the same in reverse as it does forwards.
I thought it might be fun to provide a distinctly non-...
10
votes
4
answers
2k
views
Checking whether a string is a permutation of a palindrome in C++20
(See the next iteration/follow-up here.)
I have this short function is_permutation_palindrome, which returns true only if the ...
2
votes
3
answers
599
views
Recursive palindrome check
I'm trying to solve this which basically calls for a recursive palindrome check with some minor extra steps (Special characters and whitespace can be ignored). The test inputs' length can be 100000 ...
26
votes
6
answers
7k
views
Close to the metal C++ Palindrome Program
I am attempting to reinvent the wheel by writing my own palindrome checking program in C++, using only basic loops and mathematical operations. I have arrived at a solution, but was wondering if it's ...
7
votes
5
answers
1k
views
Checking whether a string is a permutation of a palindrome in C++20 - follow-up
This post is the follow-up of Checking whether a string is a permutation of a palindrome in C++20.
So, what's new? Well, nothing else except that the procedure is now generic and accepts all ...
4
votes
1
answer
157
views
Is Palindrom-function in Swift
Task is simply to write the classic isPalindrom-function.
Here's my implementation:
...
21
votes
10
answers
5k
views
Palindromes in C
The function tests whether or not the provided string is a palindrome, and the main function just times how quick it is (after all, C's supposed to be quick, right?)...
15
votes
5
answers
6k
views
Palindrome checking function
I recently did a little task for fun that required me to create a class to determine if a word is a palindrome or not. I know this is quite simple, but I'd be interested to know if a real developer (I'...