Skip to main content

Questions tagged [palindrome]

Any sequence of units (typically letters or numbers) that are read the same way forward or backward.

3 votes
4 answers
3k views

Find longest Palindrome substring

I am preparing for technical interview and I found this question on geeksforgeeks, but I did not understand their solution. So, I have written my own solution. I want to optimize this code. ...
coder's user avatar
  • 2,449
-2 votes
1 answer
90 views

Find the first palindrome larger than the given number

Question Input number of test cases. Input each test case and output its next palindrome number. Link: https://www.spoj.com/problems/PALIN/ Language Used: C++14 (gcc 6.3) My code ...
suyashsingh234's user avatar
1 vote
1 answer
52 views

A program that checks for Palindromness

Yes, I made it up. This program checks if an entered string is a palindrome or not by assigning a char variable the characters ...
Gabriel Diaz's user avatar
2 votes
2 answers
724 views

Find a palindromic string in C

This program tests whether a string is a palindrome or not. Can there be any improvements or shortcuts that can be used in the program. You can give any type of string as input. The program finds does ...
Shaik Mohammed Zeeshan's user avatar
10 votes
5 answers
477 views

Circles of numbers

I have a function: ...
kharandziuk's user avatar
7 votes
3 answers
3k views

The Next Palindromic number

I have incremented an integer in the function nextpalin() and converted it into a std::string for finding whether it's a ...
vibhanshu kumar's user avatar
0 votes
1 answer
204 views

Find largest palindrome from the product of two 3-digit numbers

I think this is a good solution to finding the largest numeric palindrome that can be formed from the product of two 3-digit numbers... But it seems like there are some improvements that we could make ...
Jonathan Mee's user avatar
7 votes
1 answer
3k views

Check if a given linked list is palindrome

I am solving interview questions from here. Problem :Given a singly linked list, determine if its a palindrome. Return 1 or 0 denoting if its a palindrome or not, respectively. Notes:Expected ...
Latika Agarwal's user avatar
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? ...
MadHatter's user avatar
  • 837
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'...
Matadeleo's user avatar
  • 263
0 votes
1 answer
95 views

Finding time complexity of my solution to the 'longest palindrome' problem in Python

Here is a short version! ...
imperialgendarme's user avatar
2 votes
2 answers
10k views

Count palindrome substrings

Given a string S, count and return the number of substrings of S that are palindromes. Single length substrings are also palindromes. We just have to count the substring that are palindrome. ...
sahil mehta's user avatar
1 vote
2 answers
2k views

Palindrome algorithm

This code could be better? This is the algorithm: Compare the 1st character to the last character Compare the 2nd character to the second last character and so on Stop when the middle of the ...
Pankwood's user avatar
  • 173
3 votes
2 answers
3k views

Largest palindrome made from the product of 3-digit numbers

I am given a task to write a program to find the largest palindrome made from the product of two 3-digit numbers. How can I improve this code? ...
Latika Agarwal's user avatar
4 votes
2 answers
1k views

Finding palindromic strings of even length

Given a string of digits. Find the length of longest substring of even length i.e. 0,2,... which is a palindrome or which can be rearranged to form a palindrome (see example below). Here is my code: ...
katty's user avatar
  • 605

15 30 50 per page
1
3 4
5
6 7
18