Skip to main content

All Questions

1 vote
2 answers
160 views

Making my DP algorithm faster - longest palindromic substring

The following code is my solution to a LeetCode question - find the longest palindromic substring. My code is 100% correct, it passed once but it took too long, and in most of the reruns I hit a "...
ela16's user avatar
  • 113
3 votes
1 answer
262 views

Longest Palindromic Substring | Python Code Giving TLE

Problem Statement Given a string s , return the longest palindromic substring in s. Constraints ...
Rohit Singh'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
1 vote
1 answer
210 views

Finding longest palindromic substring in a string (gives TLE on leetcode)

I'm solving the Longest Palindromic Substring problem on LeetCode. And here's my final submission: ...
Joe D's user avatar
  • 113
1 vote
3 answers
654 views

Finding n-th smallest Palindrome number (where 1<=n<=5000 and the palindrome number must have odd number of digits)

I am working on this code from 3 days from a website called Codechef, the code compiles, executes and even give correct results but my code is taking 1.01 sec, but the time limit for question is 1sec,...
Prince's user avatar
  • 125
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 ...
Atul Vani's user avatar
-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
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
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
3 votes
2 answers
175 views

Code Chef RAINBOW Palindrome

Problem Determine whether an array is "Rainbow", i.e. it has the following structure: First a1 elements equal 1. Next a2 elements equal 2. Next a3 elements equal 3. Next a4 elements ...
Pooja Rani's user avatar
3 votes
1 answer
818 views

SPOJ: smallest palindrome larger than a given number

I am working on the SPOJ palindrome question. I'm using JAVA to solve it. The problem: A positive integer is called a palindrome if its representation in the decimal system is the same when read ...
Gastly Yoi's user avatar
7 votes
4 answers
17k views

Calculate the number of palindrome numbers in the given ranges

I've written a program that calculates all of the palindrome numbers in the given range, but the code is slightly slower than needed. I've tried to improve algorithmic complexity to the best of my ...
shubhendu's user avatar
  • 231
1 vote
1 answer
671 views

Project Euler #4 - Largest Palindrome Project - Python

I solved the HackerRank version of the Largest palindrome problem (similar to Project Euler 4) in Python: Find the largest palindrome made from the product of two 3-digit numbers which is less than ...
Aswin Mohan's user avatar
4 votes
2 answers
613 views

Number of possible palindrome sequences

Here is the problem description from hackerearth.com: Rohan loves Palindromes. Palindrome is a string that read same forward and backward. For example abba is ...
Shashank's user avatar
  • 255
3 votes
2 answers
4k views

Finding the index of the character whose removal will make a palindrome

Before I get into describing by problem I'd like to point out I found this question under c++ tag. But the solution of that question is already implemented in my ...
Kaushal28's user avatar
  • 455

15 30 50 per page