Program to find the largest palindrome in an array | faceprep

Program to find the largest palindrome in an array | faceprep

The 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


Program to find the largest palindrome in an array


"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:nnInput:n4n5 131 54545 1111118nnOutput:n54545nnInput:n6n2 4 5 8 25 61nnOutput:n8n



Program to find the largest palindrome in an array

Largest Palindrome in an Array

Asked in recruitment drive of Oracle.n


@@coding::1@@



Recommended Programs





Program to find the largest palindrome in an array