(int[] a, int n)
| 1 | public static int palinArray(int[] a, int n) |
| 2 | { |
| 3 | //add code here. |
| 4 | // Traverse all array elements one by one |
| 5 | for(int num: a) |
| 6 | { |
| 7 | // Convert array element to string |
| 8 | String number = String.valueOf(num); |
| 9 | // Get the first and last index |
| 10 | int i=0; |
| 11 | int j=number.length()-1; |
| 12 | // Check if element is palindrome or not |
| 13 | while(i<j) |
| 14 | { |
| 15 | if(number.charAt(i)!=number.charAt(j)) |
| 16 | return 0; |
| 17 | i++;j--; |
| 18 | } |
| 19 | |
| 20 | } |
| 21 | return 1; |
| 22 | } |
nothing calls this directly
no outgoing calls
no test coverage detected