Skip to main content

All Questions

Tagged with
2 votes
3 answers
544 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 ...
Yamin's user avatar
  • 125
2 votes
3 answers
137 views

Find long palindrome multiplications in modern C++

I'm a former C# programmer, updating my rusty C++98 (perhaps I should try Rust instead) to modern C++20. My main goal is to get used to C++ standard library types and algorithms. I chose to solve a ...
Thomas Weller'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
3 votes
1 answer
128 views

palindrome code in C times out in program challenge?

Hello I am making a code in C to find the value of the last sequence of palindromes of a specified size (d) and I need to optimize this code as it is for an ...
Yuri Nogueira Moreira da Silva's user avatar
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 ...
Sep Roland's user avatar
  • 4,448
3 votes
0 answers
226 views

Longest palindrome code in C# takes time out on LeetCode

I like to request a review of the code below, which is my attempt at answering the question here on LeetCode site. The code passes 43 tests, but it times out on the next one. I copied and ran the test ...
Shahin's user avatar
  • 103
4 votes
3 answers
2k views

Palindrome test

This is some code that determines if a string of characters is a palindrome or not. My professor says that there is a performance issue with the program, but I can't quite put my finger on it. Can ...
Avantika P's user avatar
10 votes
2 answers
504 views

Determining if a string can be permuted to a palindrome

I am going through Elements of Programming Interview by Aziz, Lee and Prakash one of the questions is how to determine if a string can be permuted to a palindrome. For example ...
mjl007's user avatar
  • 203
2 votes
0 answers
213 views

Longest Palindromic Substring challenge

My code is a mix-up between dynamic programming with the HashMap and brute force with the way I reach out the results and substring. I don't know how to optimize my ...
Manu Carba's user avatar
8 votes
5 answers
12k views

Find palindromic substrings as efficiently as possible

I've written a function to calculate all the distinct substrings of a given string, that are palindromes. The string is passed as the argument to the function. For example, the string abba is a ...
Matt Kent's user avatar
  • 217
3 votes
3 answers
617 views

Check if a string is palindrome or two strings are the opposite of each other

I made a function which checks if a word is the opposite of each other (ex: word and drow) and then realized that with minor changes it could also be used to detect if a word is palindrome. They both ...
Tommaso Thea's user avatar
1 vote
3 answers
546 views

Checking if a string is a palindrome

This is the code for checking if a string is a palindrome. The execution time, for sample cases, is 0.40358 seconds. What must be done to increase the performance? ...
user4641842's user avatar
26 votes
6 answers
6k 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 ...
Angular4 Kiddie's user avatar
4 votes
1 answer
3k views

Find all sub matrices of type N*M in it which are palindromic

Today I had an interview, where I was asked to solve this question. A \$N*M\$ matrix is called a palindromic matrix, if for all of its rows and columns, elements read from left to right in a row are ...
Harsha's user avatar
  • 1,291
8 votes
3 answers
2k views

Leetcode 125. Valid Palindrome (better performance?)

Problem statement Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, "A man, a plan, a canal: Panama" is a ...
Jianmin Chen's user avatar
  • 2,396

15 30 50 per page