Explore
ProGrad Programs
Placement Prep
TCS Codevita
Live Placement Training
Webinars
About Us

Edit
Reply




Edit

Program to find the largest palindrome in an array | FACE Prep

Published on 10 Mar 2020

Program to find the largest palindrome in an array is discussed below. Before we get into the problem, you need to know what a palindrome is. A palindrome is basically any text, numbers or a combination of both, which when read from first or last produces the same output. An example would be


"10101" "984565489" "Radar" "Madam"


Problem:


Given an array of non-negative integers arr[]. We need to find the largest palindrome in the array which is. If no such number exits then print -1.


Test cases:

Input:
4
5 131 54545 1111118

Output:
54545

Input:
6
2 4 5 8 25 61

Output:
8


Largest Palindrome in an Array


Asked in recruitment drive of Oracle.


C
C++
Java
Python 3

Output
Input- Enter the number of entries: Enter the elements: 12321 454 789 24631 151 Output- Largest Palindrome: 12321


Recommended Programs




If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in