![]() |
VOOZH | about |
Given an array arr[]. The task is to check if the array is PalinArray or not i.e., if all elements of array are palindrome or not.
Examples:
Input: arr[] = [21, 131, 20]
Output: false
Explanation: For the given array, element 20 is not a palindrome so false is the output.Input: arr[] = [111, 121, 222, 333, 444]
Output: true
Explanation: For the given array, all the elements of the array are palindromes.
The basic idea is to check each number in the array is a palindrome by converting each number to a string and comparing its characters symmetrically from both ends. If any non-palindrome is found then returns false otherwise true.
true
Complexity Analysis: